20 General utilities library [utilities]

20.10 Memory [memory]

20.10.8 uses_Β­allocator [allocator.uses]

20.10.8.1 uses_Β­allocator trait [allocator.uses.trait]

template<class T, class Alloc> struct uses_allocator;
Remarks: Automatically detects whether T has a nested allocator_Β­type that is convertible from Alloc.
Meets the Cpp17BinaryTypeTrait requirements ([meta.rqmts]).
The implementation shall provide a definition that is derived from true_Β­type if the qualified-id T​::​allocator_Β­type is valid and denotes a type ([temp.deduct]) and is_Β­convertible_Β­v<Alloc, T​::​allocator_Β­type> != false, otherwise it shall be derived from false_Β­type.
A program may specialize this template to derive from true_Β­type for a program-defined type T that does not have a nested allocator_Β­type but nonetheless can be constructed with an allocator where either:
  • the first argument of a constructor has type allocator_Β­arg_Β­t and the second argument has type Alloc or
  • the last argument of a constructor has type Alloc.