TPIE

11a2c2d
tpie_assert.h File Reference
#include <tpie/config.h>
#include <tpie/portability.h>
#include <iostream>
#include <tpie/tpie_log.h>
#include <cassert>

Go to the source code of this file.

Namespaces

 tpie
 

Macros

#define tp_assert_release(condition, message)
 
#define tp_assert(condition, message)   tp_assert_release(condition,message)
 

Detailed Description

Defines the tp_assert macro.

Definition in file tpie_assert.h.

Macro Definition Documentation

◆ tp_assert

#define tp_assert (   condition,
  message 
)    tp_assert_release(condition,message)
Parameters
conditionThe condition to assert
messageMessage describing the erroneous condition

Definition at line 65 of file tpie_assert.h.

◆ tp_assert_release

#define tp_assert_release (   condition,
  message 
)
Value:
{ \
if (!((condition) && 1)) { \
TP_LOG_FATAL_ID("Assertion failed:"); \
TP_LOG_FATAL_ID(message); \
std::cerr << "Assertion (" #condition ") failed " __FILE__ ":" \
<< __LINE__ << ": " << message << "\n"; \
std::terminate(); \
assert(condition); \
} \
}

Assertions also enabled for Release builds

Parameters
conditionThe condition to assert
messageMessage describing the erroneous condition

Definition at line 43 of file tpie_assert.h.