std::add_cv, std::add_const, std::add_volatile
From Cppreference
Defined in header <type_traits>
|
||
template< class T >
struct add_cv; |
(1) | (C++11 feature) |
template< class T >
struct add_const; |
(2) | (C++11 feature) |
template< class T >
struct add_volatile; |
(3) | (C++11 feature) |
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 |
[edit] Member types
Name | Definition |
type | the type T with the cv-qualifier |
[edit] Equivalent definition
template< class T > struct add_cv { typedef typename std::add_volatile<typename std::add_const<T>::type>::type type; }; template< class T> struct add_const { typedef const T type; }; template< class T> struct add_volatile { typedef volatile T type; }; |
[edit] Example
This section is incomplete |
[edit] See also
|
checks if a type is const-qualified (class template) |
||
|
checks if a type is volatile-qualified (class template) |
||
|
removes const or/and volatile specifiers from the given type (class template) |