KASSERT
0.0.1
Karlsruhe Assertion Library
|
Assertion macros provided by KAssert
.
More...
Macros | |
#define | KASSERT(...) |
Assertion macro. Accepts between one and three parameters. More... | |
#define | THROWING_KASSERT(...) |
Macro for throwing exceptions. Accepts between one and three parameters. More... | |
#define | THROWING_KASSERT_SPECIFIED(expression, message, exception_type, ...) KASSERT_KASSERT_HPP_THROWING_KASSERT_CUSTOM_IMPL(expression, exception_type, message, ##__VA_ARGS__) |
Macro for throwing custom exception. More... | |
Assertion macros provided by KAssert
.
#define KASSERT | ( | ... | ) |
Assertion macro. Accepts between one and three parameters.
Assertions are enabled or disabled by setting a compile-time assertion level (-DKASSERT_ASSERTION_LEVEL=<int>
). For predefined assertion levels, see Assertion levels. If an assertion is enabled and fails, the KASSERT() macro prints an expansion of the expression similar to Catch2. This process is described in Expression Expansions.
The macro accepts 1 to 3 parameters:
<<
operator to build the error message similar to how one would use std::cout
.kassert::assert::normal
, see Assertion levels). #define THROWING_KASSERT | ( | ... | ) |
Macro for throwing exceptions. Accepts between one and three parameters.
Exceptions are only used in exception mode, which is enabled by using the CMake option -DKASSERT_EXCEPTION_MODE=On
. Otherwise, the macro generates a KASSERT() with assertion level kassert::assert::kthrow
(lowest level).
The macro accepts 1 to 2 parameters:
false
(mandatory).<<
operator to build the error message similar to how one would use std::cout
. #define THROWING_KASSERT_SPECIFIED | ( | expression, | |
message, | |||
exception_type, | |||
... | |||
) | KASSERT_KASSERT_HPP_THROWING_KASSERT_CUSTOM_IMPL(expression, exception_type, message, ##__VA_ARGS__) |
Macro for throwing custom exception.
The macro requires at least 2 parameters:
false
(mandatory).<<
operator to build the error message similar to how one would use std::cout
.std::string
as its first argument, followed by any additional parameters passed to this macro. 4, 5, 6, ... Parameters that are forwarded to the exception type's ctor.Any other parameter is passed to the constructor of the exception class.