Does std::is_unsigned imply std::is_integral

  • A+
Category:Languages

If I need a type that satisfy std::is_unsigned and std::is_integral, do I have to check both or only std::is_unsigned?

 


cppreference has this line for is_unsigned (https://en.cppreference.com/w/cpp/types/is_unsigned):

this results in true for the unsigned integer types and the type bool and in false for the signed integer types and the floating-point types. For any other type, value is false.

so if is_unsigned is true, then is_integral will as well.

Comment

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: