std::add_cv, std::add_const, std::add_volatile - cppreference.com
De cppreference.com
<metanoindex/>
<tbody> </tbody>
| Definido no cabeçalho <type_traits> |
||
|
|
(1) | (desde C++11) |
|
|
(2) | (desde C++11) |
|
|
(3) | (desde 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
Tipos de membro
Nome Original: Name The text has been machine-translated via Google Translate. |
Definition |
type
|
the type T with the cv-qualifier
|
Possível implementação
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; };
Exemplo
Veja também
(C++11) |
verifica se um tipo é const qualificado Original: checks if a type is const-qualified The text has been machine-translated via Google Translate. (modelo de classe) [edit] |
(C++11) |
verifica se um tipo é volátil qualificado Original: checks if a type is volatile-qualified The text has been machine-translated via Google Translate. (modelo de classe) [edit] |
(C++11) |
remove Original: removes The text has been machine-translated via Google Translate. (modelo de classe) [edit] |