std::pmr::p...or::destroy(3)

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

✨ NAME ✨

Okay so bestie, this is the std::pmr::polymorphic_allocator::destroy(3) page from the C++ Standard Library (the header literally says β€œLibary” and honestly? iconic typo energy πŸ’€). The NAME is std::pmr::polymorphic_allocator::destroy β€” yes, again: std::pmr::polymorphic_allocator::destroy. We love a repetitive queen. πŸ‘‘

πŸ“œ Synopsis

template< class U >    (since C++17)
void destroy( U* p );  (deprecated in C++20)
                       (undeprecated in C++26)

It destroys the object pointed to by p, as if by calling p->~U(). That’s the whole move. Slay. πŸ’…

πŸŽ€ Parameters

  • p β€” pointer to the object being destroyed. That’s it, that’s the parameter. 🫢

πŸ’… Notes

This function is deprecated via LWG issue 3036, because its functionality can be provided by the default implementation of std::allocator_traits::destroy and hence extraneous. So yeah, the committee was like β€œwe don’t need this extra,” no cap.

This function is undeprecated via P2875R3. The glow-up is real. ✨

🌈 See also

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

Cute little sign-off: source is http://cppreference.com, dated 2024.06.10, and the footer title vibe is std::pmr::p...or::destroy(3). Bye bestie, go destroy responsibly πŸ’–πŸŽ€

πŸ“¦ where this page comes from