std::genera...ratordelete(3)

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

πŸ’– NAME πŸ’–

okay bestie, this page is about std::generator::promise_type::operatordelete β€” and yes, the NAME section literally says std::generator::promise_type::operatordelete - std::generator::promise_type::operatordelete, so we're saying it twice because that's what the page does. πŸ’… This is from the C++ Standard Libary manual, and the manpage tag is std::genera...ratordelete(3).


✨ Synopsis ✨

Here's the signature, no cap:

void operator delete( void* ptr, std::size_t n ) noexcept;

since C++23 ✨

so the way that this works: it deallocates the storage pointed to by ptr using an allocator equivalent to that used to allocate this memory. 🫢

⚠️ important vibe check: the ptr passed to this function must be the one returned from an invocation of one of the operator new overloads with a size argument equal to n. Otherwise the behavior is undefined. like, do not play with that. 😭

🌸 Parameters 🌸

  • ptr β€” a pointer obtained from the previous call to operator new.
  • n β€” the size of the storage to be deallocated.

🫢 Return value 🫢

(none) β€” literally no return value, bestie. iconic.


mwah πŸ’‹ β€” source: http://cppreference.com, version/date: 2024.06.10

πŸ“¦ where this page comes from