<xstd/ints/type_traits/make_unsigned.hpp>¶
xstd::make_unsigned, xstd::make_unsigned_t¶
template<class T>
struct make_unsigned;
template<class T>
using make_unsigned_t = typename make_unsigned<T>::type;
The unsigned counterpart of an integral, enumeration or integer-class type.
Member types¶
| Type | Definition |
|---|---|
type |
the unsigned counterpart of T, where it has one, as below |
- For a cv-unqualified integral or enumeration type other than
bool, the membertypeisstd::make_unsigned_t<T>. - For a cv-unqualified type that models
integer_class, is notstd::integraland is unsigned,typeisT. - For a cv-qualified
Twhose unqualified type has a membertype,typeis that with the same qualifiers. A cv-qualified type takes no other path, so it has a membertypeexactly when its unqualified type does. - Otherwise there is no member
type, somake_unsigned_t<T>is a substitution failure wherestd::make_unsigned_t<T>would be a hard error:bool,double,int*,complex<double>andvoidhave none.
Remarks¶
A program may specialize it for the signed half of an integer-class pair, as the ext headers do.
Notes¶
Every signed exact-width type maps to a type modelling unsigned_integer.
See also¶
| Entity | Relation |
|---|---|
make_signed |
the other direction |
make_unsigned<signed _BitInt(N)> |
the bit-precise specializations |
integer |
asks that the two be mutually inverse |
boost::int128, absl::int128 |
the ext headers' specializations |
std::make_unsigned |
the standard trait it extends |