23 General utilities library [utilities]

23.15 Metaprogramming and type traits [meta]

23.15.7 Transformations between types [meta.trans]

23.15.7.1 Const-volatile modifications [meta.trans.cv]

Table 40 — Const-volatile modifications
Template
Comments
template <class T>
struct remove_­const;
The member typedef type names the same type as T except that any top-level const-qualifier has been removed.
[Example
:
remove_­const_­t<const volatile int> evaluates to volatile int, whereas remove_­const_­t<const int*> evaluates to const int*.
end example
]
template <class T>
struct remove_­volatile;
The member typedef type names the same type as T except that any top-level volatile-qualifier has been removed.
[Example
:
remove_­volatile_­t<const volatile int> evaluates to const int, whereas remove_­volatile_­t<volatile int*> evaluates to volatile int*.
end example
]
template <class T>
struct remove_­cv;
The member typedef type shall be the same as T except that any top-level cv-qualifier has been removed.
[Example
:
remove_­cv_­t<const volatile int> evaluates to int, whereas remove_­cv_­t<const volatile int*> evaluates to const volatile int*.
end example
]
template <class T>
struct add_­const;
If T is a reference, function, or top-level const-qualified type, then type names the same type as T, otherwise T const.
template <class T>
struct add_­volatile;
If T is a reference, function, or top-level volatile-qualified type, then type names the same type as T, otherwise T volatile.
template <class T>
struct add_­cv;
The member typedef type names the same type as add_­const_­t<add_­volatile_­t<T>>.