Page 1 of 1

Assertions

Posted: Sun Mar 08, 2015 5:13 am
by christian
Assertions - https://docs.unrealengine.com/latest/IN ... index.html
check(expression);

This macro executes the expression and, if it results in a false assertion, halts execution. The expression is only executed if the macro is compiled into the build (DO_CHECK=1). This is the simplest form of the check() macros.

Examples:

Code: Select all

check(Mesh != nullptr);
check(bWasInitialized && "Did you forget to call Init()?");
Extremely useful. Also has a checkf() version that behaves like printf().