Namespaces
Variants
Views
Actions

std::add_cv, std::add_const, std::add_volatile

From cppreference.com
< cpp‎ | types
Revision as of 01:23, 12 June 2012 by P12bot (Talk | contribs)

Template:cpp/types/sidebar Template:ddcl list begin <tr class="t-dsc-header">

<td>
Defined in header <type_traits>
</td>

<td></td> <td></td> </tr> <tr class="t-dcl ">

<td >
template< class T >
struct add_cv;
</td>

<td > (1) </td> <td > (since C++11) </td> </tr> <tr class="t-dcl ">

<td >
template< class T >
struct add_const;
</td>

<td > (2) </td> <td > (since C++11) </td> </tr> <tr class="t-dcl ">

<td >
template< class T >
struct add_volatile;
</td>

<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 const and volatile

2) adds const

3) adds volatile

Contents

Member types

Template:tdcl list begin Template:tdcl list hitem Template:tdcl list item |}

Possible implementation

Template:eq fun cpp

Example

See also

(C++11)
checks if a type is const-qualified
(class template) [edit]
checks if a type is volatile-qualified
(class template) [edit]
removes const and/or volatile specifiers from the given type
(class template) [edit]