vSMC
vSMC: Scalable Monte Carlo
Classes | Namespaces | Macros
assert.hpp File Reference
#include <vsmc/internal/config.hpp>
#include <cassert>
#include <cstdio>
#include <stdexcept>
#include <string>

Go to the source code of this file.

Classes

struct  vsmc::internal::StaticAssert< bool >
 
struct  vsmc::internal::StaticAssert< true >
 
class  vsmc::RuntimeAssert
 
class  vsmc::RuntimeWarning
 

Namespaces

 vsmc
 
 vsmc::internal
 

Macros

#define VSMC_RUNTIME_ASSERT(cond, msg)
 
#define VSMC_RUNTIME_WARNING(cond, msg)
 
#define VSMC_STATIC_ASSERT(cond, msg)   static_assert(cond, #msg)
 

Macro Definition Documentation

#define VSMC_RUNTIME_ASSERT (   cond,
  msg 
)
Value:
{ \
if (!(cond)) { \
std::fprintf(stderr, \
"vSMC runtime assertion failed; File: %s; Line: %d\n%s\n", \
__FILE__, __LINE__, msg); \
std::fflush(stderr); \
}; \
assert(cond); \
}

Definition at line 64 of file assert.hpp.

#define VSMC_RUNTIME_WARNING (   cond,
  msg 
)
Value:
{ \
if (!(cond)) { \
std::fprintf(stderr, \
"vSMC runtime warning; File: %s; Line: %d\n%s\n", \
__FILE__, __LINE__, msg); \
std::fflush(stderr); \
}; \
}

Definition at line 84 of file assert.hpp.

#define VSMC_STATIC_ASSERT (   cond,
  msg 
)    static_assert(cond, #msg)

Definition at line 46 of file assert.hpp.