std::add_cv, std::add_const, std::add_volatile
Da cppreference.com.
|
|
Questa pagina è stata tradotta in modo automatico dalla versione in ineglese della wiki usando Google Translate.
La traduzione potrebbe contenere errori e termini strani. Muovi il puntatore sopra al testo per vedere la versione originale. Puoi aiutarci a correggere gli gli errori. Per ulteriori istruzioni clicca qui. |
<metanoindex/>
<tbody> </tbody>| Elemento definito nell'header <type_traits>
|
||
template< class T > struct add_cv; |
(1) | (dal C++11) |
template< class T > struct add_const; |
(2) | (dal C++11) |
template< class T > struct add_volatile; |
(3) | (dal 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
Membri tipi
Nome
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
|
Possibile implementazione
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; };
|
Esempio
| This section is incomplete Reason: no example |
Vedi anche
(C++11) |
controlla se è un tipo const qualificati Original: checks if a type is const-qualified The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (classe template) |
(C++11) |
controlla se è un tipo di volatili qualificato Original: checks if a type is volatile-qualified The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (classe template) |
(C++11) (C++11) (C++11) |
rimuove const e / o identificatori di volatile dal tipo di dato Original: removes const or/and volatile specifiers from the given type The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (classe template) |