std::add_cv, std::add_const, std::add_volatile
Материал из cppreference.com
|
|
This page has been machine-translated from the English version of the wiki using Google Translate.
The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |
| Заголовочный файл <type_traits>
|
||
| template< class T > struct add_cv; |
(1) | (начиная с C++11) |
| template< class T > struct add_const; |
(2) | (начиная с C++11) |
| template< class T > struct add_volatile; |
(3) | (начиная с 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
Содержание |
[править] Член типов
| Имя
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
|
[править] Возможная реализация
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; }; |
[править] Пример
| Этот раздел не завершён Причина: нет примера |
[править] См. также
| (C++11) |
проверяет, является ли тип конструкции квалификацию 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. (шаблон класса) |
| (C++11) |
проверяет, является ли тип летучих квалификации 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. (шаблон класса) |
| (C++11) (C++11) (C++11) |
удаляет const и / или volatile спецификаторы от данного типа 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. (шаблон класса) |