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