Go to the documentation of this file.
35 #ifndef StaticAssert_H
36 #define StaticAssert_H
43 template<
bool Truth>
class StaticAssertionFailed;
56 template<
unsigned Test>
66 #define StaticAssertMacro(X,Y) StaticAssertMacro1(X,Y)
67 #define StaticAssertMacro1(X,Y) StaticAssertMacro2(X,Y)
68 #define StaticAssertMacro2(X,Y) X##Y
76 #define StaticAssert(Test) \
77 typedef ::Foam::StaticAssertionTest \
79 sizeof( ::Foam::StaticAssertionFailed< ((Test) ? true : false) > ) \
80 > StaticAssertMacro(StaticAssertionTest, __LINE__)