How to check that template's parameter type is integral?

前端 未结 4 662
南笙
南笙 2021-01-12 09:11

In the description of some std template function I saw something like:

if the template parameter is of integral type, the behavior is such and such.

4条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-12 09:32

    If you are unable to use C++11 features, std::numeric_limits::is_integer does the same thing as std::is_integral::value, and is available with C++98.

    Note that the 98 version is integer, not integral.

提交回复
热议问题