std::allocator_arg
来自cppreference.com
| 在标头 <memory> 定义
|
||
| struct allocator_arg_t { explicit allocator_arg_t() = default; }; |
(C++11 起) | |
| constexpr std::allocator_arg_t allocator_arg = std::allocator_arg_t(); |
(C++11 起) (C++17 前) |
|
| inline constexpr std::allocator_arg_t allocator_arg = std::allocator_arg_t(); |
(C++17 起) | |
std::allocator_arg_t 是一个空类类型,用于对具分配器对象的构造函数和成员函数的重载消解歧义,它们包括 std::tuple、std::function、std::packaged_task (C++17 前) 和 std::promise。std::allocator_arg 是它的一个常量。
[编辑] 缺陷报告
下列更改行为的缺陷报告追溯地应用于以前出版的 C++ 标准。
| 缺陷报告 | 应用于 | 出版时的行为 | 正确行为 |
|---|---|---|---|
| LWG 2510 | C++11 | 默认构造非 explicit,可能导致歧义 | 使之explicit |
[编辑] 参阅
| (C++11) |
检查指定的类型是否支持使用分配器的构造 (类模板) |

