8#include <botan/exceptn.h>
9#include <botan/internal/fmt.h>
12#if defined(BOTAN_TERMINATE_ON_ASSERTS)
30 throw Invalid_State(
fmt(
"Invalid state: expr {} was false in {}:{}", expr, func, file));
34 const char* assertion_made,
39 std::ostringstream format;
41 format <<
"False assertion ";
43 if(assertion_made && assertion_made[0] != 0)
44 format <<
"'" << assertion_made <<
"' (expression " << expr_str <<
") ";
46 format << expr_str <<
" ";
49 format <<
"in " << func <<
" ";
51 format <<
"@" << file <<
":" << line;
53#if defined(BOTAN_TERMINATE_ON_ASSERTS)
54 std::cerr << format.str() <<
'\n';
void throw_invalid_state(const char *expr, const char *func, const char *file)
void throw_invalid_argument(const char *message, const char *func, const char *file)
std::string fmt(std::string_view format, const T &... args)
void assertion_failure(const char *expr_str, const char *assertion_made, const char *func, const char *file, int line)