2017-02-26 19:29:50 +01:00
|
|
|
|
#include <sstream>
|
|
|
|
|
|
#include <stdexcept>
|
|
|
|
|
|
|
|
|
|
|
|
namespace boost
|
|
|
|
|
|
{
|
|
|
|
|
|
void assertion_failed(char const * expr, char const * function, char const * file, long line)
|
|
|
|
|
|
{
|
|
|
|
|
|
std::ostringstream out;
|
2018-09-18 20:24:54 +02:00
|
|
|
|
out << "Assertion failure int " << function << " " << file << ":" << line << "\n" << expr;
|
2017-02-26 19:29:50 +01:00
|
|
|
|
throw std::runtime_error(out.str());
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void assertion_failed_msg(char const * expr, char const * msg, char const * function, char const * file, long line)
|
|
|
|
|
|
{
|
|
|
|
|
|
std::ostringstream out;
|
2018-09-18 20:24:54 +02:00
|
|
|
|
out << "Assertion failure int " << function << " " << file << ":" << line << "\n" << msg << "\n" << expr;
|
2017-02-26 19:29:50 +01:00
|
|
|
|
throw std::runtime_error(out.str());
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|