[meta.trans.cv]

# 21 Metaprogramming library [[meta]](./#meta)

## 21.3 Metaprogramming and type traits [[type.traits]](type.traits#meta.trans.cv)

### 21.3.9 Transformations between types [[meta.trans]](meta.trans#cv)

#### 21.3.9.2 Const-volatile modifications [meta.trans.cv]

[1](#1)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/meta.tex#L1976)

The templates specified in Table [57](#tab:meta.trans.cv "Table 57: Const-volatile modifications") add or remove cv-qualifications ([[basic.type.qualifier]](basic.type.qualifier "6.9.5 CV-qualifiers"))[.](#1.sentence-1)

Table [57](#tab:meta.trans.cv) — Const-volatile modifications [[tab:meta.trans.cv]](./tab:meta.trans.cv)  

| [ð](#tab:meta.trans.cv-row-1)<br>**Template** | **Comments** |
| --- | --- |
| [ð](#tab:meta.trans.cv-row-2)<br>template<class T>   struct remove_const; | The member typedef type denotes the type formed  by removing any top-level const-qualifier from T[.](#tab:meta.trans.cv-row-2-column-2-sentence-1)<br>[*Example [1](#tab:meta.trans.cv-row-2-column-2-example-1)*:<br>remove_const_t<const volatile int> evaluates  to volatile int, whereas remove_const_t<const int*> evaluates to  const int*[.](#tab:meta.trans.cv-row-2-column-2-sentence-2) â *end example*] |
| [ð](#tab:meta.trans.cv-row-3)<br>template<class T>   struct remove_volatile; | The member typedef type denotes the type formed  by removing any top-level volatile-qualifier from T[.](#tab:meta.trans.cv-row-3-column-2-sentence-1)<br>[*Example [2](#tab:meta.trans.cv-row-3-column-2-example-2)*:<br>remove_volatile_t<const volatile int>  evaluates to const int,  whereas remove_volatile_t<volatile int*> evaluates to volatile int*[.](#tab:meta.trans.cv-row-3-column-2-sentence-2) â *end example*] |
| [ð](#tab:meta.trans.cv-row-4)<br>template<class T>   struct remove_cv; | The member typedef type denotes the type formed  by removing any top-level cv-qualifiers from T[.](#tab:meta.trans.cv-row-4-column-2-sentence-1)<br>[*Example [3](#tab:meta.trans.cv-row-4-column-2-example-3)*:<br>remove_cv_t<const volatile int>  evaluates to int, whereas remove_cv_t<const volatile int*>  evaluates to const volatile int*[.](#tab:meta.trans.cv-row-4-column-2-sentence-2) â *end example*] |
| [ð](#tab:meta.trans.cv-row-5)<br>template<class T>   struct add_const; | The member typedef type denotes const T[.](#tab:meta.trans.cv-row-5-column-2-sentence-1)<br>[*Note [1](#tab:meta.trans.cv-row-5-column-2-note-1)*:<br>const has no effect when T is a reference, function, or top-level const-qualified type[.](#tab:meta.trans.cv-row-5-column-2-sentence-2) â *end note*] |
| [ð](#tab:meta.trans.cv-row-6)<br>template<class T>   struct add_volatile; | The member typedef type denotes volatile T[.](#tab:meta.trans.cv-row-6-column-2-sentence-1)<br>[*Note [2](#tab:meta.trans.cv-row-6-column-2-note-2)*:<br>volatile has no effect when T is a reference, function, or top-level volatile-qualified type[.](#tab:meta.trans.cv-row-6-column-2-sentence-2) â *end note*] |
| [ð](#tab:meta.trans.cv-row-7)<br>template<class T>   struct add_cv; | The member typedef type denotes  add_const_t<add_volatile_t<T>>[.](#tab:meta.trans.cv-row-7-column-2-sentence-1) |
