21 Metaprogramming library [meta]

21.3 Metaprogramming and type traits [type.traits]

21.3.8 Transformations between types [meta.trans]

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

The templates specified in Table 54 add or remove cv-qualifications ([basic.type.qualifier]).
Table 54: Const-volatile modifications [tab:meta.trans.cv]
Template
Comments
template<class T>
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<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 denotes the type formed by removing any top-level volatile-qualifier from T.
[Example 2: 
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 denotes the type formed by removing any top-level cv-qualifiers from T.
[Example 3: 
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 denotes T, otherwise T const.
template<class T>
struct add_volatile;
If T is a reference, function, or top-level volatile-qualified type, then type denotes T, otherwise T volatile.
template<class T>
struct add_cv;
The member typedef type denotes add_const_t<add_volatile_t<T>>.