std::allocation_result
From cppreference.com
 
 
 
 
 
 C++ 
 Feature test macros (C++20)
 Concepts library (C++20)
 Metaprogramming library (C++11)
 Ranges library (C++20)
 Filesystem library (C++17)
 Concurrency support library (C++11)
 Execution control library (C++26)
Memory management library 
 
 
 
 
 
 
 
 
 
 
 
 
Uninitialized memory algorithms  
 
 
 
 
 
 
 
 
 
 
 
 Constrained uninitialized memory algorithms  
 
 
 
 
 
 
 
 
 
 
 
 Memory resources  
 
 
 
 
 
 
 
 
 
 
 Uninitialized storage (until C++20) 
 
 
 
 
 
 Garbage collector support (until C++23) 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
(exposition only*)
(C++11)
allocation_result
(C++23)
(C++11)
(C++17)
(C++11)
(C++11)
(C++20)
(C++20)
(C++17)
(C++11)
(C++17)
(C++20)
(C++17)
(C++17)
(C++17)
(C++17)
(C++17)
(C++17)
(C++20)
(C++20)
(C++20)
(C++20)
 (C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++17)
(C++17)
(C++17)
(C++17)
(C++17)
(C++17)
(C++17)
(C++17)
(until C++20*)
(until C++20*)
(until C++20*)
(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)
(C++11)
(C++11)
(C++17)
(C++20)
(C++17)
(C++11)
(C++11)
(C++11)
(until C++17*)
(C++11)
(C++17)
(C++26)
(C++26)
(C++11)
(C++11)
(C++11)
(C++23)
(C++23)
(C++11)
(C++20)
(C++11)
(C++11)
(C++20)
(C++26)
Defined in header 
 
 
<memory> 
 template< class Pointer, class SizeType = std::size_t >
struct allocation_result;
 
 (since C++23) 
struct allocation_result;
allocation_result specializations are returned from the allocate_at_least member function of appropriate Allocator types (e.g. std::allocator::allocate_at_least) and std::allocator_traits::allocate_at_least.
Every specialization of allocation_result has no base classes or declared members other than ptr and count, thus it is suitable for aggregate initialization and structured binding.
[edit] Template parameters
[edit] Data members
 Member name
 Definition
ptr
Pointer which is typically used for the address of the first element in the storage allocated by allocate_at_least (public member object)
count
SizeType which is typically used for the actual number of elements in the storage allocated by allocate_at_least (public member object)
[edit] Notes
Pointer and SizeType are a pointer to an object type and std::make_unsigned_t <std::ptrdiff_t > (which is almost always same as std::size_t ) by default.
| Feature-test macro | Value | Std | Feature | 
|---|---|---|---|
| __cpp_lib_allocate_at_least | 202302L | (C++23) | Size-feedback in the Allocator interface | 
[edit] Example
 This section is incomplete
Reason: no example
Reason: no example
[edit] See also
(C++23)
(public member function of
std::allocator<T>) [edit] 
[static] (C++23)
(public static member function of
std::allocator_traits<Alloc>) [edit]