##### cppreference.com

##### Search

Create account

##### Namespaces

- Page
- Discussion

##### Variants

##### Views

- View
- Edit
- History

##### Actions

# std::allocator::max_size

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

Defined in header `<memory>` |  |
size_type max_size() const |  |

Returns the maximum theoretically possible value of `n`, for which the call `allocate(n, 0)` could succeed.

In most implementations, this returns std::numeric_limits<size_type>::max().

### [edit] Parameters

(none)

### [edit] Return value

The maximum supported allocation size

### [edit] Exceptions

(none) | (until C++11)
`noexcept` specification: noexcept | (since C++11)

### [edit] See also

max_size [static] | returns the maximum object size supported by the allocator (public static member function of `std::allocator_traits`) [edit]

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

- unconditionally noexcept