| std::allocator_arg,std::allocator_arg_t(3) | C++ Standard Libary | std::allocator_arg,std::allocator_arg_t(3) |
NAME¶
std::allocator_arg,std::allocator_arg_t - std::allocator_arg,std::allocator_arg_t
Synopsis¶
Defined in header <memory> struct allocator_arg_t { explicit
allocator_arg_t() = default; }; (1) (since C++11) constexpr
std::allocator_arg_t allocator_arg {}; (2) (since C++11)
(inline since C++17)
1) std::allocator_arg_t is an empty class type used to disambiguate the overloads of constructors and member functions of allocator-aware objects, including std::tuple , std::function, std::packaged_task, (until C++17) and std::promise. 2) std::allocator_arg is an instance of (1) that can be passed to the constructors and member functions of such permitted types.
Defect reports
The following behavior-changing defect reports were applied retroactively to previously published C++ standards.
DR Applied to Behavior as published Correct behavior LWG 2510 C++11 the
default constructor was non-explicit, which could made explicit
lead to ambiguity
See also¶
uses_allocator checks if the specified type supports uses-allocator construction (C++11) (class template)
| 2026.11.10 | http://cppreference.com |