std::forwar...orward_list(3)

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

πŸ’– std::forward_list::~forward_list πŸ’–

okay so bestie, we’re deep in the C++ Standard Libary β€” yes, that’s the manual name, spelling included 😭 β€” and the page title is std::forward_list::~forward_list, aka the destructor. The header even truncates it as std::forwar...orward_list(3), which is giving β€œwe ran out of room” energy πŸ’€.


πŸŽ€ NAME πŸŽ€

  • std::forward_list::~forward_list β€” std::forward_list::~forward_list

Like, that’s the name, fr fr: std::forward_list::~forward_list is std::forward_list::~forward_list. No notes πŸ’….


✨ Synopsis ✨

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

So the destructor is ~forward_list();, and it’s been a thing since C++11 ⭐.

It destructs the forward_list. The destructors of the elements are called, and the used storage is deallocated. Big important note though: if the elements are pointers, the pointed-to objects are not destroyed β€” the list handles its own elements and storage, but it does not chase pointers and clean up whatever they point at. periodt 🫢.


πŸ¦‹ Complexity πŸ¦‹

Linear in the size of the forward_list β€” so yeah, it’s giving β€œwalks through the whole list” realness ⭐.


mwah πŸ’‹ β€” source/version: http://cppreference.com, dated 2024.06.10, page std::forwar...orward_list(3).

πŸ“¦ where this page comes from