20 General utilities library [utilities]

20.6 Memory [memory]

20.6.11 Temporary buffers [temporary.buffer]

template <class T> pair<T*, ptrdiff_t> get_temporary_buffer(ptrdiff_t n) noexcept;

Effects: Obtains a pointer to storage sufficient to store up to n adjacent T objects. It is implementation-defined whether over-aligned types are supported ([basic.align]).

Returns: A pair containing the buffer's address and capacity (in the units of sizeof(T)), or a pair of 0 values if no storage can be obtained or if n <= 0.

template <class T> void return_temporary_buffer(T* p);

Effects: Deallocates the buffer to which p points.

Requires: The buffer shall have been previously allocated by get_temporary_buffer.