CACAO
|
Additional assertion macros. More...
Go to the source code of this file.
Macros | |
#define | STATIC_ASSERT(EXPR, MSG) static_assert(EXPR, MSG); |
An assertion that is evaluated at compile time. More... | |
#define | EXPENSIVE_ASSERT(EXPR) assert(EXPR) |
An assertion that performs computations too expensive even for a normal debug build. More... | |
Additional assertion macros.
Definition in file assert.hpp.
#define EXPENSIVE_ASSERT | ( | EXPR | ) | assert(EXPR) |
An assertion that performs computations too expensive even for a normal debug build.
EXPENSIVE_ASSERT is even disabled in a normal debug build. You can enable these assertions explicitly by configuring CACAO with: –enable-expensive-assert
Definition at line 90 of file assert.hpp.
#define STATIC_ASSERT | ( | EXPR, | |
MSG | |||
) | static_assert(EXPR, MSG); |
An assertion that is evaluated at compile time.
The evaluated expression must be a compile time constant.
If possible this uses the C++11 static_assert feature, otherwise it uses a fallback that produces substantially worse error messages.
A static assert can appear anywhere a typedef can, that is, in global, class or function scope. In order to support disabling static assertions STATIC_ASSERT does not require a trailing ';'
An example:
Definition at line 59 of file assert.hpp.