BOOST_STATIC_ASSERT without boost

前端 未结 6 1206

Since boost is forbidden in a company I work for I need to implement its functionality in pure C++. I\'ve looked into boost sources but they seem to be too complex to unders

6条回答
  •  醉酒成梦
    2020-11-30 03:22

    I believe this should work:

    template struct CompileTimeAssert;   
    template<> struct CompileTimeAssert{};
    #define STATIC_ASSERT(e) (CompileTimeAssert <(e) != 0>())
    

提交回复
热议问题