00001 #ifndef COMPILE_ASSERT_H_ 00002 #define COMPILE_ASSERT_H_ 00003 00004 #define _IMP_CONCAT(A, B) A ## B 00005 #define CONCAT(A, B) _IMP_CONCAT(A, B) 00006 #define COMPILE_ASSERT(E) typedef StaticAssertionTest<sizeof(CompileAssert<(bool)E>)> CONCAT(assertion, __LINE__); 00007 00008 template<int> 00009 struct StaticAssertionTest {}; 00010 00011 template<bool> 00012 struct CompileAssert; 00013 00014 template<> 00015 struct CompileAssert<true> {}; 00016 00017 #endif