std::allocator_arg, std::allocator_arg_t

From cppreference.com
< cpp‎ | memory
Memory management library
(exposition only*)
Uninitialized memory algorithms
(C++17)
(C++17)
(C++17)
(C++20)
Constrained uninitialized
memory algorithms
(C++20)
C Library

Allocators
allocator_arg
(C++11)
(C++11)
Memory resources
Garbage collection support
(C++11)(until C++23)
(C++11)(until C++23)
(C++11)(until C++23)
(C++11)(until C++23)
(C++11)(until C++23)
(C++11)(until C++23)
Uninitialized storage
(until C++20*)
(until C++20*)
(until C++20*)
Explicit lifetime management
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)

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 lead to ambiguity made explicit

See also

(C++11)
checks if the specified type supports uses-allocator construction
(class template)