std::uses_allocator
Материал из 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. |
| Заголовочный файл <memory>
|
||
| template< class T, class Alloc > struct uses_allocator |
(начиная с C++11) | |
Если
T имеет член ЬурейеЕ allocator_type которая кабриолет от Alloc, обеспечивает постоянный член value равно true. В противном случае value является false.Original:
If
T has a member typedef allocator_type which is convertible from Alloc, provides the member constant value equal to true. Otherwise value is false.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
Содержание |
Унаследован от std::integral_constant
Member constants
| value [static] |
true если T uses allocator Alloc, false иначе Original: true if T uses allocator Alloc, false otherwise The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (public static константа-член) |
Member functions
| operator bool |
преобразует объект в bool, возвращает value Original: converts the object to bool, returns value The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (public функция-член) |
Member types
| Type
Original: Type The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
Definition |
value_type
|
bool
|
type
|
std::integral_constant<bool, value> |
[править] Специализации
Пользовательские специализации типа черту std::uses_allocator допускается для типов, которые не имеют членов ЬурейеЕ
1) allocator_type, но удовлетворяют одному из следующих двух требований:Original:
Custom specializations of the type trait std::uses_allocator are allowed for types that do not have the member typedef
allocator_type but satisfy one of the following two requirements:The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
T имеет конструктор, который принимает std::allocator_arg_t в качестве первого аргумента, и Alloc в качестве второго аргумента.Original:
T has a constructor which takes std::allocator_arg_t as the first argument, and Alloc as the second argument.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
T имеет конструктор, который принимает Alloc в качестве последнего аргумента.Original:
T has a constructor which takes Alloc as the last argument.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
Следующим специализациям уже предусмотрены в стандартной библиотеке
Original:
The following specializations are already provided by the standard library:
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
| Специализируется черта std::uses_allocator типа Original: specializes the std::uses_allocator type trait The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (специализация шаблона класса) | |
| Специализируется черта std::uses_allocator типа Original: specializes the std::uses_allocator type trait The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (шаблон функции) | |
| Специализируется черта std::uses_allocator типа Original: specializes the std::uses_allocator type trait The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (шаблон функции) | |
| Специализируется черта std::uses_allocator типа Original: specializes the std::uses_allocator type trait The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (шаблон функции) | |
| Специализируется черта std::uses_allocator типа Original: specializes the std::uses_allocator type trait The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (специализация шаблона класса) | |
| Специализируется черта std::uses_allocator типа Original: specializes the std::uses_allocator type trait The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (специализация шаблона класса) | |
| Специализируется черта std::uses_allocator типа Original: specializes the std::uses_allocator type trait The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (специализация шаблона класса) | |
[править] Notes
Этот тип черта используется std::scoped_allocator_adaptor и могут быть использованы пользовательские распределители, чтобы определить, является ли объект строится сама способна использовать распределитель (например, является контейнером), в этом случае распределителя должны быть переданы в конструктор.
Original:
This type trait is used by std::scoped_allocator_adaptor and may be used by custom allocators to determine whether the object being constructed is itself capable of using an allocator (e.g. is a container), in which case an allocator should be passed to its constructor.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
[править] См. также
| (C++11) |
Объект типа std::allocator_arg_t используется для выбора распределитель-Aware конструкторов Original: an object of type std::allocator_arg_t used to select allocator-aware constructors The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (константа) |
| (C++11) |
тег типа используются для выбора распределитель-Aware перегрузок конструктора Original: tag type used to select allocator-aware constructor overloads 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: implements multi-level allocator for multi-level containers The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (шаблон класса) |