std::allocator_arg, std::allocator_arg_t

Header: <memory>

  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.

# Declarations

struct allocator_arg_t { explicit allocator_arg_t() = default; };

(since C++11)

constexpr std::allocator_arg_t allocator_arg {};

(since C++11) (inline since C++17)

# Defect reports

DRApplied toBehavior as publishedCorrect behavior
LWG 2510C++11the default constructor was non-explicit, which could lead to ambiguitymade explicit

# See also