Assertions

Post Reply
User avatar
christian
Posts: 1683
Joined: Mon Feb 09, 2015 5:21 pm
Location: Houston, TX

Assertions

Post 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().
Post Reply