std::allocation_result(3)
π NAME π
std::allocation_result - std::allocation_result. okay so bestie, welcome to the C++ Standard Libary manual β this page is literally the name twice, and that's iconic.
β¨ Synopsis β¨
Defined in header <memory>
template< class Pointer, class SizeType = std::size_t > (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.
π Template parameters π
Pointerβ typicallystd::allocator_traits<Alloc>::pointer, whereAllocis anAllocatortype.SizeTypeβ typicallystd::allocator_traits<Alloc>::size_type, whereAllocis anAllocatortype.
π¦ Data members π¦
Member name β Definition:
ptrβ a pointer of typePointerwhich is typically used for the address of the first element in the storage allocated byallocate_at_least(public member object).countβ a value of typeSizeTypewhich is typically used for the actual number of elements in the storage allocated byallocate_at_least(public member object).
πΈ 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 π₯
__cpp_lib_allocate_at_leastβ value202302L, std(C++23), feature:Size-feedback in the Allocator interface.
π Example π
This section is incomplete Reason: no example
π See also π
allocate_at_leastβ allocates uninitialized storage at least as large as requested. (C++23)size(public member function ofstd::allocator<T>).allocate_at_leastβ allocates storage at least as large as the requested size via anallocate_at_leastallocator. [static] (C++23) (public static member function ofstd::allocator_traits<Alloc>).
π Category π
* Todo no example
π that's the whole page, bestie β source/version/date: http://cppreference.com Β· 2024.06.10 Β· page: std::allocation_result(3) π
π¦ where this page comes from
- nixpkgs unstable: stdman 2024.07.05
- opensuse-leap 16.0: stdman 2024.07.05-bp160.1.9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms