# std::allocator_traits<Alloc>::deallocate

> C++ Atlas: `cppatlas.com/w/cpp/memory/allocator_traits/deallocate` | Source: https://en.cppreference.com/w/cpp/memory/allocator_traits/deallocate | Domain: Memory management | Standards: C++11, C++20

Uses the allocator a to deallocate the storage referenced by p, by calling a.deallocate(p, n).

## Official Specification Summary (cppreference)

```cpp
// Defined in header <memory>
static void deallocate( Alloc& a, pointer p, size_type n ); // (since C++11) (constexpr since C++20)
```

Uses the allocator `a` to deallocate the storage referenced by `p`, by calling `a.deallocate(p, n)`.

### Parameters

- `a` - allocator to use
- `p` - pointer to the previously allocated storage
- `n` - the number of objects the storage was allocated for

### Return value

(none)

### Example

> Note: This section is incomplete Reason: no example

### See also

- [`allocate`](https://en.cppreference.com/w/cpp/memory/allocator_traits/allocate) [static]: allocates uninitialized storage using the allocator (public static member function)
- [`deallocate`](https://en.cppreference.com/w/cpp/memory/allocator/deallocate): deallocates storage (public member function of `std::allocator<T>`)

---
Attribution: content from https://en.cppreference.com/w/cpp/memory/allocator_traits/deallocate (cppreference.com), licensed under CC-BY-SA 3.0 and GFDL. Modified: converted to markdown, study notes added. Offline snapshot of 9 February 2025.