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

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

    std::is_integral_v will only return true for built-in integers.

    The standard allows std::numeric_limits::is_integer to be specialized and return true for custom integral types like boost::multiprecion::cpp_int.

提交回复
热议问题