Protium
Math and Design Features
 All Classes Namespaces Files Functions Variables Typedefs Enumerator Friends Macros Pages
Assert.h
Go to the documentation of this file.
1 #ifndef Protium_Assert_h_
2 #define Protium_Assert_h_
3 
4 #include <stdlib.h>
5 #include <iostream>
6 
8 template<int>
10 
12 template<>
13 struct CompileTimeError<true> {};
14 
16 #define PROTIUM_STATIC_ASSERT(expr, msg) \
17  { CompileTimeError<((expr) != 0)> ERROR_##msg; (void)ERROR_##msg; }
18 
20 #define PROTIUM_RUNTIME_ASSERT(expr, msg)\
21  {if(!expr) std::cerr<<##msg<<std::endl; abort();}
22 
23 #endif //Protium_Assert_h_
Body-less template.
Definition: Assert.h:9