20 General utilities library [utilities]

20.10 Memory [memory]

20.10.10 The default allocator [default.allocator]

20.10.10.1 Members [allocator.members]

Except for the destructor, member functions of the default allocator shall not introduce data races as a result of concurrent calls to those member functions from different threads.
Calls to these functions that allocate or deallocate a particular unit of storage shall occur in a single total order, and each such deallocation call shall happen before the next allocation (if any) in this order.
[[nodiscard]] constexpr T* allocate(size_t n);
Mandates: T is not an incomplete type ([basic.types]).
Returns: A pointer to the initial element of an array of n T.
Remarks: The storage for the array is obtained by calling ​::​operator new, but it is unspecified when or how often this function is called.
This function starts the lifetime of the array object, but not that of any of the array elements.
Throws: bad_­array_­new_­length if numeric_­limits<size_­t>​::​max() / sizeof(T) < n, or bad_­alloc if the storage cannot be obtained.
constexpr void deallocate(T* p, size_t n);
Preconditions: p is a pointer value obtained from allocate().
n equals the value passed as the first argument to the invocation of allocate which returned p.
Effects: Deallocates the storage referenced by p .
Remarks: Uses ​::​operator delete, but it is unspecified when this function is called.