Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
Macros
assert.hpp File Reference

Shamrock assertion utility. More...

+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define ASSERT_MODE_CASSERT   1
 Use C assert for shamrock assertion.
 
#define ASSERT_MODE_RUNTIME_ERROR   2
 Use C++ exception for shamrock assertion.
 
#define SHAM_ASSERT_NAMED(message, condition)
 Macro to assert that a condition is true.
 
#define SHAM_ASSERT(x)   SHAM_ASSERT_NAMED(#x, x)
 Shorthand for SHAM_ASSERT_NAMED without a message.
 

Detailed Description

Shamrock assertion utility.

Author
Timothée David–Cléris (tim.s.nosp@m.hamr.nosp@m.ock@p.nosp@m.roto.nosp@m.n.me)

Definition in file assert.hpp.

Macro Definition Documentation

◆ ASSERT_MODE_CASSERT

#define ASSERT_MODE_CASSERT   1

Use C assert for shamrock assertion.

Definition at line 19 of file assert.hpp.

◆ ASSERT_MODE_RUNTIME_ERROR

#define ASSERT_MODE_RUNTIME_ERROR   2

Use C++ exception for shamrock assertion.

Definition at line 20 of file assert.hpp.

◆ SHAM_ASSERT

#define SHAM_ASSERT (   x)    SHAM_ASSERT_NAMED(#x, x)

Shorthand for SHAM_ASSERT_NAMED without a message.

Definition at line 67 of file assert.hpp.

◆ SHAM_ASSERT_NAMED

#define SHAM_ASSERT_NAMED (   message,
  condition 
)
Value:
do { \
} while (false)

Macro to assert that a condition is true.

Definition at line 40 of file assert.hpp.