Namespaces
Variants
Views
Actions

std::allocator_traits::max_size

From cppreference.com
 
 
Dynamic memory management
Uninitialized storage
(C++17)
Garbage collection support
Miscellaneous
(C++20)
(C++11)
(C++11)
C Library
Low level memory management
 
 
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() (until C++17)std::numeric_limits<size_type>::max() / sizeof(value_type) (since C++17)

Contents

[edit] Parameters

(none)

[edit] Return value

Theoretical maximum allocation size

[edit] Exceptions

noexcept specification:  
noexcept
  

[edit] See also

(deprecated in C++17)(removed in C++20)
returns the largest supported allocation size
(public member function of std::allocator) [edit]