模拟static_assert

template<bool> struct CompileTimeError;
template<> struct CompileTimeError<true>{};


#define STATIC_ASSERT(expr) \
    CompileTimeError<(expr)>()


posted @ 2013-03-28 20:07  javawebsoa  Views(168)  Comments(0Edit  收藏  举报