std::set::~set(3)

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

πŸŽ€ std::set::~set(3) πŸŽ€

okay so this page lives in the C++ Standard Libary manual, and it’s all about std::set::~set β€” the destructor, bestie. yes, that :: and ~ combo is giving main character energy πŸ’….


🌸 NAME 🌸

std::set::~set - std::set::~set

✨ Synopsis ✨

~set();

okay so here’s the whole vibe: this destructor destructs the set. The destructors of the elements are called and the used storage is deallocated. but bestie, important plot twist: if the elements are pointers, the pointed-to objects are not destroyed. like, the set is done, but it is not out here deleting whatever your pointers point at. no cap πŸ˜­πŸ’€.

πŸ¦‹ Complexity πŸ¦‹

Linear in the size of the set. so yeah, it’s giving β€œwalk the whole set” energy, not constant-time magic ✨.


that’s the whole page, bestie β€” source/version/date straight from http://cppreference.com on 2024.06.10, filed under std::set::~set(3) πŸ’–πŸ’…βœ¨

πŸ“¦ where this page comes from