std::uses_allocator<std::variant>
template <class... Types, class Alloc> struct uses_allocator<std::variant<Types...>, Alloc> : std::true_type { }; | ? | (since C++17) |
---|
提供std::uses_allocator
类型性状std::variant
通知其他库组件可以使用分配器构造变体,即使它没有嵌套的allocator_type
...
类型要求
*。
-分配器必须符合分配器的要求。
继承自STD:积分[医]常量
成员常数
value static | true (public static member constant) |
---|
成员函数
operator bool | converts the object to bool, returns value (public member function) |
---|---|
operator() (C++14) | returns value (public member function) |
成员类型
Type | Definition |
---|---|
value_type | bool |
type | std::integral_constant<bool, value> |
注记
大std::variant
它本身不使用分配器,而是传递到包含的值的构造函数。
例
另见
uses_allocator (C++11) | checks if the specified type supports uses-allocator construction (class template) |
---|
? cppreference.com
在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。
本文档系腾讯云开发者社区成员共同维护,如有问题请联系 cloudcommunity@tencent.com