std::experi...or::allocate(3)

πŸ“¦ version 2024.07.05, in nixpkgs unstable, opensuse-leap 16.0

πŸ¦‹ std::experi...or::allocate(3) β€” the allocate page, but make it cute πŸ¦‹

okay so bestie, this is the std::experi...or::allocate(3) manual page from the C++ Standard Libary β€” yep, that’s the header spelling, and I’m leaving it exactly as it is, no cap. The actual star of the show is std::experimental::pmr::polymorphic_allocator::allocate, and she’s literally the same name in the NAME section because that’s how this page rolls. πŸ’…

✨ NAME ✨

std::experimental::pmr::polymorphic_allocator::allocate β€” that’s the whole name, bestie. It’s giving long-name main character energy, and yes, it appears again because NAME said so. πŸ‘‘

πŸ¦‹ Synopsis πŸ¦‹

Here’s the signature, copied exactly because we do not play with code:

T* allocate( std::size_t n );  (library fundamentals TS)

She allocates storage for n objects of type T using the underlying memory resource. Equivalent to:

return static_cast<T*>(this->resource()->allocate(n * sizeof(T), alignof(T)));.
That trailing period after the semicolon is part of the original line, okay? Keep it. 🫢

πŸ“ Parameters πŸ“

  • n β€” the number of objects to allocate storage for. That’s the whole parameter tea. πŸ“

πŸ’œ Return value πŸ’œ

A pointer to the allocated storage. Periodt, that’s the return value. πŸ’œ

πŸ‘‘ See also πŸ‘‘

  • allocate β€” allocates uninitialized storage using the allocator. [static] (public static member function of std::allocator_traits<Alloc>). πŸ‘‘
  • deallocate β€” deallocates memory (public member function of std::experimental::pmr::memory_resource). πŸ’…

🌈 Category 🌈

  • * Noindexed pages β€” the category, exactly as it appears. 🌈

with love from http://cppreference.com, version 2024.06.10, and the manual name std::experi...or::allocate(3) β€” mwah πŸ’‹βœ¨

πŸ“¦ where this page comes from