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 but complementary to assert(expr). Unlike assert(expr), __promise(expr) is effective when NDEBUG is defined.

If assertions are enabled (by including assert.h and not defining NDEBUG) then the promise is checked at runtime by evaluating expr as part of assert(expr).