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. |
| Defined in header <memory>
|
||
| template< class T, class Alloc > struct uses_allocator |
(C++11 起) | |
如果
T有一个的成员typedefallocator_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.
目录 |
Inherited from std::integral_constant
Member constants
| value [静态的] </ SPAN></div></div>
|
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. (公共静态成员常量) |
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. (公共成员函数) |
Member types
| 类型
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> |
</div>
[编辑] 专业化
自定义的类型特征std::uses_allocator所允许的类型,不具备的成员typedef
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. (类模板专业化) | |
[编辑] 注释
此类型的特征是所使用的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用来选择分配器感知的构造函数 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) |
使用的标签类型选择分配器感知的构造函数重载 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. (类模板) |