tlx
Loading...
Searching...
No Matches
die.hpp File Reference
#include <tlx/die/core.hpp>

Go to the source code of this file.

Namespaces

namespace  tlx
 

Macros

#define die(msg)
 Instead of std::terminate(), throw the output the message via an exception.
 
#define die_unless(X)
 Check condition X and die miserably if false.
 
#define die_if(X)
 Check condition X and die miserably if true.
 
#define die_verbose_unless(X, msg)
 Check condition X and die miserably if false.
 
#define die_verbose_if(X, msg)
 Check condition X and die miserably if false.
 
#define die_unequal(X, Y)
 Check that X == Y or die miserably, but output the values of X and Y for better debugging.
 
#define assert_equal(X, Y)
 Check that X == Y or die miserably, but output the values of X and Y for better debugging.
 
#define die_verbose_unequal(X, Y, msg)
 Check that X == Y or die miserably, but output the values of X and Y for better debugging.
 
#define die_unequal_eps(X, Y, eps)
 Check that ABS(X - Y) <= eps or die miserably, but output the values of X and Y for better debugging.
 
#define die_verbose_unequal_eps(X, Y, eps, msg)
 Check that ABS(X - Y) <= eps or die miserably, but output the values of X and Y for better debugging.
 
#define die_unequal_eps6(X, Y)
 Check that ABS(X - Y) <= 0.000001 or die miserably, but output the values of X and Y for better debugging.
 
#define die_verbose_unequal_eps6(X, Y, msg)
 Check that ABS(X - Y) <= 0.000001 or die miserably, but output the values of X and Y for better debugging.
 
#define die_equal(X, Y)
 Die miserably if X == Y, but first output the values of X and Y for better debugging.
 
#define assert_unequal(X, Y)
 Die miserably if X == Y, but first output the values of X and Y for better debugging.
 
#define die_verbose_equal(X, Y, msg)
 Die miserably if X == Y, but first output the values of X and Y for better debugging.
 
#define die_unless_throws(code, exception_type)
 Define to check that [code] throws and exception of given type.
 

Macro Definition Documentation

◆ assert_equal

#define assert_equal ( X,
Y )

Check that X == Y or die miserably, but output the values of X and Y for better debugging.

Only active if NDEBUG is not defined.

Definition at line 55 of file die.hpp.

◆ assert_unequal

#define assert_unequal ( X,
Y )

Die miserably if X == Y, but first output the values of X and Y for better debugging.

Only active if NDEBUG is not defined.

Definition at line 99 of file die.hpp.

◆ die

#define die ( msg)

Instead of std::terminate(), throw the output the message via an exception.

Definition at line 22 of file die.hpp.

◆ die_equal

#define die_equal ( X,
Y )

Die miserably if X == Y, but first output the values of X and Y for better debugging.

Definition at line 94 of file die.hpp.

◆ die_if

#define die_if ( X)

Check condition X and die miserably if true.

Opposite of assert() except this is also active in Release mode.

Definition at line 32 of file die.hpp.

◆ die_unequal

#define die_unequal ( X,
Y )

Check that X == Y or die miserably, but output the values of X and Y for better debugging.

Definition at line 50 of file die.hpp.

◆ die_unequal_eps

#define die_unequal_eps ( X,
Y,
eps )

Check that ABS(X - Y) <= eps or die miserably, but output the values of X and Y for better debugging.

Definition at line 69 of file die.hpp.

◆ die_unequal_eps6

#define die_unequal_eps6 ( X,
Y )

Check that ABS(X - Y) <= 0.000001 or die miserably, but output the values of X and Y for better debugging.

Definition at line 80 of file die.hpp.

◆ die_unless

#define die_unless ( X)

Check condition X and die miserably if false.

Same as assert() except this is also active in Release mode.

Definition at line 27 of file die.hpp.

◆ die_unless_throws

#define die_unless_throws ( code,
exception_type )

Define to check that [code] throws and exception of given type.

Definition at line 112 of file die.hpp.

◆ die_verbose_equal

#define die_verbose_equal ( X,
Y,
msg )

Die miserably if X == Y, but first output the values of X and Y for better debugging.

Same as die_equal() except the user additionally passes a message.

Definition at line 105 of file die.hpp.

◆ die_verbose_if

#define die_verbose_if ( X,
msg )

Check condition X and die miserably if false.

Same as die_if() except the the user additionally passes a message.

Definition at line 42 of file die.hpp.

◆ die_verbose_unequal

#define die_verbose_unequal ( X,
Y,
msg )

Check that X == Y or die miserably, but output the values of X and Y for better debugging.

Same as die_unequal() except the user additionally passes a message.

Definition at line 61 of file die.hpp.

◆ die_verbose_unequal_eps

#define die_verbose_unequal_eps ( X,
Y,
eps,
msg )

Check that ABS(X - Y) <= eps or die miserably, but output the values of X and Y for better debugging.

Same as die_unequal_eps() except the user additionally passes a message.

Definition at line 75 of file die.hpp.

◆ die_verbose_unequal_eps6

#define die_verbose_unequal_eps6 ( X,
Y,
msg )

Check that ABS(X - Y) <= 0.000001 or die miserably, but output the values of X and Y for better debugging.

Same as die_unequal_eps6() except the user additionally passes a message.

Definition at line 86 of file die.hpp.

◆ die_verbose_unless

#define die_verbose_unless ( X,
msg )

Check condition X and die miserably if false.

Same as die_unless() except the user additionally passes a message.

Definition at line 37 of file die.hpp.