34 virtual std::string
build_message(
const char* condition_text,
const std::string& msg,
35 bool constant_expression =
false )
throw();
37 void setup(
const char* condition,
const std::string&
message,
bool constant_expression );
47 const
std::
string&
message,
bool constant_expression = false );
70#ifndef N_ERS_STATIC_ASSERT
71# define ERS_STATIC_ASSERT( expr ) \
73 ers::Compile_time_error<( ( expr ) != 0 )> ERROR_ASSERTION_FAILED; \
74 (void)ERROR_ASSERTION_FAILED; \
77# define ERS_STATIC_ASSERT( expr )
90# define ERS_ASSERT( expr, ... ) \
94 char assertion_buffer[256]; \
95 snprintf( assertion_buffer, sizeof( assertion_buffer ), __VA_ARGS__ ); \
96 ers::Assertion failed_assertion( ERS_HERE, ers::error, #expr, assertion_buffer, \
97 __builtin_constant_p( expr ) ); \
98 throw failed_assertion; \
102# define ERS_ASSERT( expr, ... ) \
106 char assertion_buffer[256]; \
107 snprintf( assertion_buffer, sizeof( assertion_buffer ), __VA_ARGS__ ); \
108 ers::Assertion failed_assertion( ERS_HERE, ers::error, #expr, assertion_buffer, \
110 throw failed_assertion; \
115# define ERS_ASSERT( expr, ... ) ( (void)( expr ) )
static const char *const MESSAGE_ELEMENTS[]
static const char *const CLASS_NAME
static const char *const ASSERT_CONDITION_KEY
void setup(const char *condition, const std::string &message, bool constant_expression)
virtual const char * get_class_name() const
Get key for class (used for serialisation).
virtual std::string build_message(const char *condition_text, const std::string &msg, bool constant_expression=false)
Assertion(const Context &context, severity_t s)
Source context for Issue.
const std::string & message() const
Message.
enum ers::_severity_t severity_t
compile time error structure.