std::allocator<T>::max_size

From cppreference.com
< cpp‎ | memory‎ | allocator
Memory management library
(exposition only*)
Uninitialized memory algorithms
(C++17)
(C++17)
(C++17)
(C++20)
Constrained uninitialized
memory algorithms
(C++20)
C Library

Allocators
(C++11)
(C++11)
Memory resources
Garbage collection support
(C++11)(until C++23)
(C++11)(until C++23)
(C++11)(until C++23)
(C++11)(until C++23)
(C++11)(until C++23)
(C++11)(until C++23)
Uninitialized storage
(until C++20*)
(until C++20*)
(until C++20*)
Explicit lifetime management
std::allocator
Member functions
(until C++20)
allocator::max_size
(until C++20)
(until C++20)
(until C++20)
Non-member functions
(until C++20)
size_type max_size( ) const throw ( ) ;
(until C++11)
size_type max_size() const noexcept;
(since C++11)
(deprecated in C++17)
(removed in C++20)

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

In most implementations, this returns std::numeric_limits <size_type> :: max ( ) / sizeof(value_type)

Parameters

(none)

Return value

The maximum supported allocation size.

See also

[static]
returns the maximum object size supported by the allocator
(public static member function of std::allocator_traits<Alloc>)