[allocator.uses.trait] (original) (raw)

20 Memory management library [mem]

20.2 Memory [memory]

20.2.8 uses_allocator [allocator.uses]

20.2.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.

The implementation shall provide a definition that is derived from true_type if the qualified-id T​::​allocator_typeis valid and denotes a type ([temp.deduct]) andis_convertible_v<Alloc, T​::​allocator_type> != false, otherwise it shall be derived from false_type.

A program may specialize this template to derive fromtrue_type for a program-defined type T that does not have a nestedallocator_type but nonetheless can be constructed with an allocator where either: