C++11 provides two type trait template classes: std::is_integer and std::is_integral. However, I cannot tell the differences between them.
What type, say T, can make std::is_integer<T>::value true and make std::is_integral<T>::value false?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
std::is_integer<T>does not exist.That being said,
std::numeric_limits<T>::is_integerdoes exist.I’m not aware of any significant difference between
std::numeric_limits<T>::is_integerandstd::is_integral<T>. The latter was designed much later and became standard in C++11, whereas the former was introduced in C++98.