std::scoped...or::allocate(3)
π NAME π
okay bestie, this is std::scoped_allocator_adaptor::allocate β page title std::scoped...or::allocate(3) β from the C++ Standard Libary manual, section 3. The whole point? It uses the outer allocator to allocate uninitialized storage. That's the vibe. π
β¨ Synopsis β¨
Defined in header <scoped_allocator>.
The source dump got a lil scrambled with the(1)/(2)labels, but they're the two overloads β no hint, and with hint β and these signatures are exact.
pointer allocate( size_type n ); (1) (since C++11) (until C++20)
[[nodiscard]] pointer allocate( size_type n ); (since C++20)
pointer allocate( size_type n, const_void_pointer hint ); (2) (since C++11) (until C++20)
[[nodiscard]] pointer allocate( size_type n, const_void_pointer hint ); (since C++20)
Overload (1) calls std::allocator_traits<OuterAlloc>::allocate(outer_allocator(), n).
Overload (2) additionally provides a memory locality hint, by calling std::allocator_traits<OuterAlloc>::allocate(outer_allocator(), n, hint).
π Parameters π
nβ the number of objects to allocate storage for. literally how many thingies you're making room for.hintβ pointer to a nearby memory location. a lil "maybe put it around here" suggestion.
π«Ά Return value π«Ά
The pointer to the allocated storage. that's your address, bestie. π
π See also π
allocateallocates uninitialized storage β public member function ofstd::allocator<T>allocateallocates uninitialized storage using the allocator β[static]public static member function ofstd::allocator_traits<Alloc>
kisses and allocator dust π
β¨ β source http://cppreference.com, version 2024.06.10, page std::scoped...or::allocate(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