std::list::~list(3)

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

πŸ’– NAME πŸ’–

okay so you're on the std::list::~list(3) page, and the manual name is C++ Standard Libary β€” yes bestie, we're in C++ standard library territory, section 3, and this whole page is about the destructor for std::list. iconic.

  • NAME line: std::list::~list - std::list::~list β€” it literally repeats itself, and honestly? main character energy πŸ‘‘.

✨ Synopsis ✨

~list();

bestie, this is the destructor. It destructs the list. The destructors of the elements are called and the used storage is deallocated. No cap.

⚠️ pointer check, listen up: if the elements are pointers, the pointed-to objects are not destroyed. Like, the list is doing its own cleanup vibe, but the things those pointers point at do not get destroyed. periodt.

πŸ¦‹ Complexity πŸ¦‹

Linear in the size of the list. That's it, that's the complexity note β€” fr fr, no extra drama.


okay bye bestie, destroy responsibly 🫢 β€” this page's source/version is http://cppreference.com, and its date is 2024.06.10. mwah πŸ’‹

πŸ“¦ where this page comes from