##### cppreference.com

##### Search

Create account

##### Namespaces

- Page
- Discussion

##### Variants

##### Views

- View
- Edit
- History

##### Actions

# std::allocator::deallocate

From cppreference.com
< cpp‎ | memory‎ | allocator

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*), but it is unspecified when and how it is called.

### [edit] Parameters

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

### [edit] Return value

(none)

### [edit] See also

allocate | allocates uninitialized storage (public member function) [edit]
deallocate [static] | deallocates storage using the allocator (public static member function of `std::allocator_traits`) [edit]

Retrieved from "http://en.cppreference.com/mwiki/index.php?title=cpp/memory/allocator/deallocate&oldid=86282"