std::pmr::p...lete_object(3)

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

πŸ’– NAME πŸ’–

okay so bestie, welcome to the std::pmr::polymorphic_allocator::delete_object page β€” whose header is literally std::pmr::p...lete_object(3) β€” from the C++ Standard Libary manual πŸ’…βœ¨.

std::pmr::polymorphic_allocator::delete_object β€” std::pmr::polymorphic_allocator::delete_object. yes, the NAME section said it twice, and honestly periodt πŸŽ€.


✨ Synopsis ✨

here's the signature, bestie β€” and yes, it's since C++20 because we're fancy like that 🌸:

template< class U >          (since C++20)
void delete_object( U* p );

This one destroys the object of type U and deallocates the storage allocated for it. that's the whole assignment, no cap πŸ’….

Equivalent to:

std::allocator_traits<polymorphic_allocator>::destroy(*this, p);
deallocate_object(p);

🌸 Parameters 🌸

  • p β€” pointer to the object to destroy and deallocate. literally the target, bestie 🎯.

πŸ’€ Exceptions πŸ’€

Throws nothing. not even a little. the calmest vibes imaginable 🫢.


πŸ¦‹ Notes πŸ¦‹

This function was introduced for use with the fully-specialized allocator std::pmr::polymorphic_allocator<>, but it may be useful in any specialization. iconic range, honestly 🌈.


πŸ‘€ See also πŸ‘€

  • deallocate_bytes β€” free raw memory obtained from allocate_bytes (C++20) (public member function) 🧚
  • deallocate_object β€” frees raw memory obtained by allocate_object (C++20) (public member function) πŸ“
  • deallocate [static] β€” deallocates storage using the allocator (public static member function of std::allocator_traits<Alloc>) ⭐
  • deallocate β€” deallocates memory (public member function of std::pmr::memory_resource) πŸ’œ

mwah πŸ’‹ β€” source/version: http://cppreference.com, date: 2024.06.10. bye bestie, go delete an object with main character energy πŸ«ΆπŸ‘‘.

πŸ“¦ where this page comes from