46 std::runtime_error(cond)
48 size_t size = strlen(cond) + strlen(file) + 500;
50 snprintf(
msg, size,
"Assertion: %s, failed in %s, line %8d.",
57 msg =
new char[ strlen(m)+1 ];
62 std::runtime_error(a.msg)
64 msg =
new char[ strlen(a.
msg)+1 ];
70 msg =
new char[ strlen(a.
msg)+1 ];
81 std::string what =
"Assertion '" + std::string(cond) +
"' failed. \n";
83 what += std::string(file) +
", line " + std::to_string(line);
85 throw std::runtime_error(what);
92 void insist(
const char *cond,
const char *msg,
const char *file,
int line )
94 size_t size = strlen(cond) + strlen(msg) + strlen(file) + 500;
95 char* fullmsg =
new char[size];
96 snprintf( fullmsg, size,
"%s\nAssertion '%s' failed in \n%s on line %8d.",
97 msg, cond, file, line );
void toss_cookies(const char *cond, const char *file, int line)
void insist(const char *cond, const char *msg, const char *file, int line)
assertion & operator=(const assertion &a)
assertion(const char *cond, const char *file, int line)