Namespaces
Variants
Actions

std::allocator<T>::max_size

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

Garbage collector support (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)
(C++11)(until C++23)
 
std::allocator
Member functions
(until C++20)
allocator::max_size
(until C++20)
(until C++20)
Non-member functions
 
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) could succeed.

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

[edit] Parameters

(none)

[edit] Return value

The maximum supported allocation size.

[edit] See also

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

Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!

Check out: eBank.nz (Art Generator) | Netwrck.com (AI Tools) | Text-Generator.io (AI API) | BitBank.nz (Crypto AI) | ReadingTime (Kids Reading) | RewordGame | BigMultiplayerChess | WebFiddle | How.nz | Helix AI Assistant