模拟static_assert

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


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


posted @ 2013-03-28 21:44  xinyuyuanm  阅读(112)  评论(0编辑  收藏  举报