Differences between std::is_integer and std::is_integral?

后端 未结 5 1889
粉色の甜心
粉色の甜心 2021-01-01 10:02

C++11 provides two type trait template classes: std::is_integer and std::is_integral. However, I cannot tell the differences between them.

5条回答
  •  天命终不由人
    2021-01-01 10:18

    std::is_integer does not exist.

    That being said, std::numeric_limits::is_integer does exist.

    I'm not aware of any significant difference between std::numeric_limits::is_integer and std::is_integral. The latter was designed much later and became standard in C++11, whereas the former was introduced in C++98.

提交回复
热议问题