3.2 KiB
3.2 KiB
[meta.trans.cv]
21 Metaprogramming library [meta]
21.3 Metaprogramming and type traits [type.traits]
21.3.9 Transformations between types [meta.trans]
21.3.9.2 Const-volatile modifications [meta.trans.cv]
The templates specified in Table 57 add or remove cv-qualifications ([basic.type.qualifier]).
Table 57 — Const-volatile modifications [tab:meta.trans.cv]
| ð Template |
Comments |
|---|---|
| ð template struct remove_const; |
The member typedef type denotes the type formed by removing any top-level const-qualifier from T. [Example 1: remove_const_t evaluates to volatile int, whereas remove_const_t<const int*> evaluates to const int*. â end example] |
| ð template struct remove_volatile; |
The member typedef type denotes the type formed by removing any top-level volatile-qualifier from T. [Example 2: remove_volatile_t evaluates to const int, whereas remove_volatile_t<volatile int*> evaluates to volatile int*. â end example] |
| ð template struct remove_cv; |
The member typedef type denotes the type formed by removing any top-level cv-qualifiers from T. [Example 3: remove_cv_t evaluates to int, whereas remove_cv_t<const volatile int*> evaluates to const volatile int*. â end example] |
| ð template struct add_const; |
The member typedef type denotes const T. [Note 1: const has no effect when T is a reference, function, or top-level const-qualified type. â end note] |
| ð template struct add_volatile; |
The member typedef type denotes volatile T. [Note 2: volatile has no effect when T is a reference, function, or top-level volatile-qualified type. â end note] |
| ð template struct add_cv; |
The member typedef type denotes add_const_t<add_volatile_t>. |