Define C4_CHECK

Synopsis

#include <src/c4/error.hpp>

#define C4_CHECK(cond)

Description

checks: never switched-off

Check that a condition is true, or raise an error when not true. Unlike C4_ASSERT(), this check is not disabled in non-debug builds.

See
C4_ASSERT
Todo
add constexpr-compatible compile-time assert: https://akrzemi1.wordpress.com/2017/05/18/asserts-in-constexpr-functions/

Mentioned in

Source

Line 309 in src/c4/error.hpp.

#define C4_CHECK(cond) \
if(C4_UNLIKELY(!(cond))) \
{ \
C4_ERROR("check failed: %s", #cond); \
}





Add Discussion as Guest

Log in