std::add_cv, std::add_const, std::add_volatile
Aus cppreference.com
<metanoindex/>
<tbody> </tbody>| definiert in Header <type_traits>
|
||
template< class T > struct add_cv; |
(1) | (seit C++11) |
template< class T > struct add_const; |
(2) | (seit C++11) |
template< class T > struct add_volatile; |
(3) | (seit C++11) |
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
Mitglied Typen
Name
Original: Name The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
Definition |
type
|
the type T with the cv-qualifier
|
Mögliche Implementierung
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; };
|
Beispiel
| This section is incomplete Reason: no example |
