46 :
std::runtime_error(cond) {
47 msg =
new char[strlen(cond) + strlen(file) + 500];
48 sprintf(
msg,
"Assertion: %s, failed in %s, line %8d.", cond, file, line);
52 :
std::runtime_error(m) {
53 msg =
new char[strlen(m) + 1];
58 :
std::runtime_error(a.msg) {
59 msg =
new char[strlen(a.
msg) + 1];
64 msg =
new char[strlen(a.
msg) + 1];
74 std::string what =
"Assertion '" + std::string(cond) +
"' failed. \n";
76 what += std::string(file) +
", line " + std::to_string(line);
78 throw std::runtime_error(what);
84void insist(
const char* cond,
const char* msg,
const char* file,
int line) {
85 char* fullmsg =
new char[strlen(cond) + strlen(msg) + strlen(file) + 500];
86 sprintf(fullmsg,
"%s\nAssertion '%s' failed in \n%s on line %8d.", msg, cond, file, line);
void insist(const char *cond, const char *msg, const char *file, int line)
void toss_cookies(const char *cond, const char *file, int line)
assertion & operator=(const assertion &a)
assertion(const char *cond, const char *file, int line)