std::unorde...ordered_set(3)

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

✨ NAME ✨

std::unordered_set::~unordered_set β€” bestie, it's literally the destructor for std::unordered_set πŸ’…

This page lives in the C++ Standard Library section of the manual, and it's giving "cleanup era" energy. 🧹✨


🌸 SYNOPSIS 🌸

~unordered_set();  (since C++11)

Okay so this is the destructor, and it's been iconic since C++11. 🫢


πŸŽ€ DESCRIPTION πŸŽ€

So what does ~unordered_set() actually do? It destructs the unordered_set. Periodt. πŸ’…

The destructors of the elements are called, and the used storage is deallocated. Very demure, very mindful cleanup. 🌸

⚠️ But bestie, listen: if the elements are pointers, the pointed-to objects are not destroyed. The set only handles its own storage β€” it does not chase down whatever your pointers are pointing at. No cap. πŸ’€

πŸ’… COMPLEXITY πŸ’…

Linear in the size of the unordered_set. So the more elements you've got, the more time it takes β€” it's giving proportional effort, not constant-time magic. 🌈


That's the whole page, bestie β€” short, sweet, and fully destructed. πŸ’–

This masterpiece of documentation was brought to you by cppreference.com, dated 2024.06.10. Go off, king. πŸ‘‘βœ¨

πŸ“¦ where this page comes from