模拟static_assert

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


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


原文地址:https://www.cnblogs.com/xinyuyuanm/p/2987682.html