You copied the Doc URL to your clipboard.

__promise intrinsic

This intrinsic represents a promise you make to the compiler that a given expression always has a nonzero value. This enables the compiler to perform more aggressive optimization when vectorizing code.


void __promise(expr)

Where expr is an expression that evaluates to nonzero.


__promise(expr) is similar to assert(). However, unlike assert(), __promise(expr) is effective even when NDEBUG is defined.

If assertions are enabled (by including assert.h and not defining NDEBUG) then the promise is additionally checked at runtime using assert().

expr is not to have side-effects, and is not evaluated unless assert.h is included and NDEBUG is not defined.