std::uses_allocator<std::flat_multiset>
来自 cppreference.cn
< cpp | container | flat multiset
定义于头文件 <flat_set> |
||
template< class Key, class Compare, class KeyContainer, class Allocator > struct uses_allocator<std::flat_multiset<Key, Compare, KeyContainer>, Allocator> |
(since C++23) | |
为 std::flat_multiset 类型特征提供了透明特化:当且仅当底层容器使用分配器时,容器适配器才使用分配器。
目录 |
继承自 std::integral_constant
成员常量
value [静态] |
true (public static member constant) |
成员函数
operator bool |
将对象转换为 bool,返回 value (public member function) |
operator() (C++14) |
返回 value (public member function) |
成员类型
类型 | 定义 |
value_type
|
bool |
type
|
std::integral_constant<bool, value> |
[编辑] 示例
运行此代码
#include <memory> #include <flat_set> static_assert( std::uses_allocator<std::flat_multiset<int>, void>::value == false && std::uses_allocator<std::flat_multiset<int>, std::allocator<int>>::value == true ); int main() {}
[编辑] 参见
(C++11) |
检查指定的类型是否支持 uses-allocator 构造 (类模板) |