std::add_cv, std::add_const, std::add_volatile
From cppreference.com
Template:cpp/types/sidebar Template:ddcl list begin <tr class="t-dsc-header">
<td>Defined in header
</td>
<type_traits>
<td></td> <td></td> </tr> <tr class="t-dcl ">
<td >template< class T >
struct add_cv;
</td>
struct add_cv;
<td > (1) </td> <td > (since C++11) </td> </tr> <tr class="t-dcl ">
<td >template< class T >
struct add_const;
</td>
struct add_const;
<td > (2) </td> <td > (since C++11) </td> </tr> <tr class="t-dcl ">
<td >template< class T >
struct add_volatile;
</td>
struct add_volatile;
<td > (3) </td> <td > (since C++11) </td> </tr> Template:ddcl list end
Provides the member typedef type
which is the same as T
, except it has a cv-qualifier added (unless T
is a function, a reference, or already has this cv-qualifier)
1) adds both Template:cpp and Template:cpp
2) adds Template:cpp
3) adds Template:cpp
Contents |
Member types
Template:tdcl list begin Template:tdcl list hitem Template:tdcl list item Template:tdcl list end
Equivalent definition
Example
See also
(C++11) |
checks if a type is const-qualified (class template) |
(C++11) |
checks if a type is volatile-qualified (class template) |
(C++11)(C++11)(C++11) |
removes const and/or volatile specifiers from the given type (class template) |