Files
cppdraft_translate/cppdraft/meta/trans/sign.md
2025-10-25 03:02:53 +03:00

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]

1

#

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.