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

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

✨ NAME ✨

std::experimental::pmr::polymorphic_allocator::destroy β€” okay so literally the whole name is just std::experimental::pmr::polymorphic_allocator::destroy, like it's the destroy member of std::experimental::pmr::polymorphic_allocator πŸŽ€ that's the vibe, that's the whole thing, bestie πŸ’…


πŸ’– Synopsis πŸ’–

template< class U >    (library fundamentals TS)
void destroy( U* p );

So it's a template over class U, and it lives in the library fundamentals TS β€” yes, the experimental one, the one that's giving "yes I'm in the standard library but make it ✨tentative✨" 🌸

And what does it do? It destroys the object pointed to by p, as if by calling p->~U(). That's it. That's the whole function. No cap, it literally just calls the destructor for you 🫢


πŸ¦‹ Parameters πŸ¦‹

  • p β€” pointer to the object being destroyed. That's the one. That's the only one. Hand it a pointer, it ends that object's whole career πŸ’€

πŸ‘‘ See also πŸ‘‘

  • destroy β€” destructs an object stored in the allocated storage, [static] (function template) ⭐

🌈 Category 🌈

  • Noindexed pages πŸ™ˆ (yes, that's really the category, we don't make the rules)

slay, you now understand a tiny experimental allocator member function, and honestly? iconic behavior 🧚

source + version + date, for the record: http://cppreference.com, 2024.06.10 β€” mwah, ty for coming to my TED talk πŸ’œ

πŸ“¦ where this page comes from