##### cppreference.com

##### Search

Create account

##### Namespaces

- Page
- Discussion

##### Variants

##### Views

- View
- Edit
- History

##### Actions

# std::allocator_traits::max_size

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

Defined in header `<memory>` |  |
static size_type max_size( const Alloc& a ) |  | (since C++11)

If possible, obtains the maximum theoretically possible allocation size from the allocator `a`, by calling

a.max_size()

If the above is not possible (e.g. `a` does not have the member function `max_size()`,), then returns

std::numeric_limits<size_type>::max()

### [edit] Parameters

(none)

### [edit] Return value

Theoretical maximum allocation size

### [edit] Exceptions

`noexcept` specification:
noexcept

### [edit] See also

max_size | returns the largest supported allocation size (public member function of `std::allocator`) [edit]

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

- unconditionally noexcept