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

后端 未结 5 1885
粉色の甜心
粉色の甜心 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:32

    The difference is that std::is_integral will only recognize decimal integers including bool char char16_t char32_t wchar_t short int long long long. While std::numeric_limits::is_integer will recognize all of those aswell as float double. Look at these two pages for more information: is_integer, is_integral

提交回复
热议问题