Checking at compile time if specified value is in a range of a type

后端 未结 4 1676
难免孤独
难免孤独 2021-01-21 17:17

Is it possible to check this:

template
struct X{};

What I mean by this is, is it possible to check that va

4条回答
  •  别那么骄傲
    2021-01-21 18:14

    Boost is the right way, but want you really want is what is coming the new C++0x standard: static asserts. Boost already implements it in boost_staticassert.

提交回复
热议问题