std::allocator<T>::deallocate (3) - Linux Manuals

std::allocator<T>::deallocate: std::allocator<T>::deallocate


std::allocator<T>::deallocate - std::allocator<T>::deallocate


void deallocate( T* p, std::size_t n );

Deallocates the storage referenced by the pointer p, which must be a pointer obtained by an earlier call to allocate().
The argument n must be equal to the first argument of the call to allocate() that originally produced p; otherwise, the behavior is undefined.
Calls ::operator_delete(void*)
or ::operator_delete(void*, std::align_val_t)
(since C++17), but it is unspecified when and how it is called.


p - pointer obtained from allocate()
n - number of objects earlier passed to allocate()

Return value


See also

           allocates uninitialized storage
allocate (public member function)

deallocate deallocates storage using the allocator
           (public static member function of std::allocator_traits<Alloc>)