Assertion macros

BLACK_ASSERT_DISABLE

If defined, disables the black_assert macro.

black_assert(Expr)

Asserts that Expr must evaluate to true.

Parameters:
  • Exprbool expression that must evaluate to true.

Throws:

bad_assert if Expr is false.

black_unreachable()

Specifies that the current line of code is unreachable.

Throws:

bad_unreachable

black_assume(Expr, Loc, Message)

Specifies that the current function assumes that Expr evaluates to true.

Parameters:
  • Exprbool expression that is assumed to be true

  • Locstd::source_location value of the function

  • Messageconst char * message to show in case of failure

Throws:

bad_assumption in case of failure