Nix (Dev) 3.5.10
dev - 3.5.10 - 1af9301
|
Functions | |
void | assertionFailure (const char *exprString, const char *assertionMade, const char *func, const char *file, int line) |
void | throwInvalidArgument (const char *message, const char *func, const char *file) |
void | throwInvalidState (const char *expr, const char *func, const char *file) |
void | assertUnreachable (const char *file, int line) |
void | assertionMessage (const char *message, const char *func, const char *file, int line) |
void | debugInfo (std::string_view message) |
void | debugMessage (std::string_view message) |
void | debugError (std::string_view message) |
template<typename T > | |
void | ignoreParam (T &&) |
template<typename... T> | |
void | ignoreParams (T &&...args) |
Variables | |
template<class... > | |
constexpr bool | always_false = false |
void iv::assert::assertionFailure | ( | const char * | exprString, |
const char * | assertionMade, | ||
const char * | func, | ||
const char * | file, | ||
int | line ) |
Called when an assertion fails Throws an Exception object
void iv::assert::assertionMessage | ( | const char * | message, |
const char * | func, | ||
const char * | file, | ||
int | line ) |
void iv::assert::assertUnreachable | ( | const char * | file, |
int | line ) |
Define assertUnreachable and IV_ASSERT_UNREACHABLE
This is intended to be used in the same situations as std::unreachable()
; a codepath that (should not) be reachable but where the compiler cannot tell that it is unreachable.
Unlike std::unreachable()
, or equivalent compiler builtins like GCC's __builtin_unreachable
, this function is not UB. By default it will throw an exception. If IV_TERMINATE_ON_ASSERTS
is defined, it will instead print a message to stderr and abort.
Due to this difference, and the fact that it is not inlined, calling this is significantly more costly than using std::unreachable
.
void iv::assert::debugError | ( | std::string_view | message | ) |
void iv::assert::debugInfo | ( | std::string_view | message | ) |
void iv::assert::debugMessage | ( | std::string_view | message | ) |
void iv::assert::ignoreParam | ( | T && | ) |
Mark variable as unused.
Takes any number of arguments and marks all as unused, for instance IV_UNUSED(a); or IV_UNUSED(x, y, z);
void iv::assert::ignoreParams | ( | T &&... | args | ) |
void iv::assert::throwInvalidArgument | ( | const char * | message, |
const char * | func, | ||
const char * | file ) |
void iv::assert::throwInvalidState | ( | const char * | expr, |
const char * | func, | ||
const char * | file ) |
|
inlineconstexpr |