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

Go to the source code of this file.

Classes

class  vsmc::internal::StaticAssert< bool >
 
class  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 failded:%s:%d:%s\n", \
__FILE__, __LINE__, msg); \
}; \
assert(cond); \
}

Definition at line 55 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 77 of file assert.hpp.

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

Definition at line 42 of file assert.hpp.