All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Macros | Functions
Run time assertions

Macros

#define BLAZE_INTERNAL_ASSERT(expr, msg)
 Run time assertion macro for internal checks.In case of an invalid run time expression, the program execution is terminated.
The BLAZE_INTERNAL_ASSERT macro can be disabled by setting the BLAZE_USER_ASSERTION flag to zero or by defining NDEBUG during the compilation.
 
#define BLAZE_USER_ASSERT(expr, msg)
 Run time assertion macro for user checks.In case of an invalid run time expression, the program execution is terminated.
The BLAZE_USER_ASSERT macro can be disabled by setting the BLAZE_USER_ASSERT flag to zero or by defining NDEBUG during the compilation.
 

Functions

bool blaze::ASSERT_MESSAGE (const char *)
 Assertion helper function.The ASSERT_MESSAGE function is a small helper function to assist in printing an informative message in case an assert fires. This function builds on the ideas of Matthew Wilson, who directly combines a C-string error message with the run time expression (Imperfect C++, ISBN: 0321228774):
 

Detailed Description

Function Documentation

bool blaze::ASSERT_MESSAGE ( const char *  )
inline

Assertion helper function.The ASSERT_MESSAGE function is a small helper function to assist in printing an informative message in case an assert fires. This function builds on the ideas of Matthew Wilson, who directly combines a C-string error message with the run time expression (Imperfect C++, ISBN: 0321228774):

assert( ... && "Error message" );
assert( ... || !"Error message" );

However, both approaches fail to compile without warning on certain compilers. Therefore this inline function is used instead of the direct approaches, which circumvents all compiler warnings:

assert( ... || ASSERT_MESSAGE( "Error message" ) );