2.3 KiB
2.3 KiB
[meta.trans.sign]
21 Metaprogramming library [meta]
21.3 Metaprogramming and type traits [type.traits]
21.3.9 Transformations between types [meta.trans]
21.3.9.4 Sign modifications [meta.trans.sign]
The templates specified in Table 59 convert an integer type to its corresponding signed or unsigned type.
Table 59 — Sign modifications [tab:meta.trans.sign]
| ð Template |
Comments |
|---|---|
| ð template struct make_signed; |
If T is a (possibly cv-qualified) signed integer type ([basic.fundamental]) then the member typedef type denotes T; otherwise, if T is a (possibly cv-qualified) unsigned integer type then type denotes the corresponding signed integer type, with the same cv-qualifiers as T; otherwise, type denotes the signed integer type with smallest rank ([conv.rank]) for which sizeof(T) == sizeof(type), with the same cv-qualifiers as T. Mandates: T is an integral or enumeration type other than cv bool. |
| ð template struct make_unsigned; |
If T is a (possibly cv-qualified) unsigned integer type ([basic.fundamental]) then the member typedef type denotes T; otherwise, if T is a (possibly cv-qualified) signed integer type then type denotes the corresponding unsigned integer type, with the same cv-qualifiers as T; otherwise, type denotes the unsigned integer type with smallest rank ([conv.rank]) for which sizeof(T) == sizeof(type), with the same cv-qualifiers as T. Mandates: T is an integral or enumeration type other than cv bool. |