<xstd/ints/type_traits/is_unsigned.hpp>¶
xstd::is_unsigned, xstd::is_unsigned_v¶
template<class T>
constexpr bool is_unsigned_v = see below;
template<class T>
using is_unsigned = bool_constant<is_unsigned_v<T>>;
Whether a type is unsigned, for the built-in types and for integer-class types alike.
Value¶
std::is_unsigned_v<T>, except for a possibly cv-qualified type that models integer_class and is not
std::integral; there, static_cast<I>(0) < static_cast<I>(-1) for I the cv-unqualified type.
Notes¶
- It agrees with
std::is_unsigned_vonint,unsigned,doubleandvoid. - It is
truefor every unsigned exact-width type,constor not, andfalsefor every signed one. - It is
trueforuint128under every cv-qualification. - An incomplete class type gives
falserather than an error.
See also¶
| Entity | Relation |
|---|---|
is_signed |
the other half |
unsigned_integer |
the concept that reads it |
integer_class |
what a class type models to reach it |
std::is_unsigned |
the standard trait it extends |