assert.h File Reference
#include "mpqc/mpqc_config.h"
#include <cassert>
#include "mpqc/util/core/exception.h"
Include dependency graph for assert.h:
This graph shows which files directly or indirectly include this file:

Macros

#define MPQC_ASSERT(...)   MPQC_ASSERT_HELPER(__VA_ARGS__, MPQC_ASSERT2, MPQC_ASSERT1)(__VA_ARGS__)
 
#define MPQC_STATIC_ASSERT(...)   MPQC_STATIC_ASSERT_HELPER(__VA_ARGS__, MPQC_STATIC_ASSERT2, MPQC_STATIC_ASSERT1)(__VA_ARGS__)
 

Macro Definition Documentation

◆ MPQC_ASSERT

#define MPQC_ASSERT (   ...)    MPQC_ASSERT_HELPER(__VA_ARGS__, MPQC_ASSERT2, MPQC_ASSERT1)(__VA_ARGS__)

MPQC_ASSERT(a, message) asserts that a is true ; if not, will produce a result that depends on the value of the MPQC_ASSERT_MODE macro

Note
message is optional
implementation follows the recipe from https://stackoverflow.com/questions/11761703/overloading-macro-on-number-of-arguments

◆ MPQC_STATIC_ASSERT

#define MPQC_STATIC_ASSERT (   ...)    MPQC_STATIC_ASSERT_HELPER(__VA_ARGS__, MPQC_STATIC_ASSERT2, MPQC_STATIC_ASSERT1)(__VA_ARGS__)

MPQC_STATIC_ASSERT(a, message) produces compile-time error if is false

Note
this implements the C++17 version of static_assert , with optional message
implementation follows the recipe from https://stackoverflow.com/questions/11761703/overloading-macro-on-number-of-arguments