std::scoped...or::destroy(3)

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

πŸ’– std::scoped...or::destroy(3) πŸ’–

okay so bestie, this is a page from the C++ Standard Libary β€” their spelling, not mine 😭 β€” and it's all about std::scoped_allocator_adaptor::destroy. she's lowkey a tiny little destructor gremlin with main character energy, and the vibe check is: the outer allocator does the destroying. periodt. πŸ’…


πŸŽ€ NAME πŸŽ€

std::scoped_allocator_adaptor::destroy - std::scoped_allocator_adaptor::destroy

ngl the NAME section is serving the same name twice and honestly? iconic. ✨


✨ Synopsis ✨

Defined in header <scoped_allocator>.

template< class T >                   (since C++11)
void destroy( T* p );

Uses the outer allocator to call the destructor of the object pointed to by p, by calling:

std::allocator_traits<OUTERMOST>::destroy(OUTERMOST(*this), p)

where OUTERMOST is the type that would be returned by calling this->outer_allocator(), and then calling the outer_allocator() member function recursively on the result of this call until reaching the type that has no such member function. yes bestie, it keeps climbing the allocator ladder until it finds the one with no outer_allocator() member function β€” that's the whole recursive vibe. πŸ¦‹


🌸 Parameters 🌸

  • p β€” pointer to the object that is going to be destroyed. literally just a pointer to the object that's about to get its destructor moment. πŸ’€

πŸ¦‹ Return value πŸ¦‹

(none) β€” no return value, she's not giving you anything back. just destruction and vibes. πŸ’…


πŸ”₯ See also πŸ”₯

  • destroy β€” destructs an object stored in the allocated storage; [static] (function template)
  • destroy β€” destructs an object in allocated storage; (until C++20) (public member function of std::allocator<T>)

mwah πŸ’‹ this cutie came from http://cppreference.com, version/date 2024.06.10, and the page tag is std::scoped...or::destroy(3). byeee bestie, go forth and destroy 🫢✨

πŸ“¦ where this page comes from