std::chrono...:erase_after(3)

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

πŸ’… NAME πŸ’…

std::chrono::tzdb_list::erase_after β€” yes bestie, it's literally the same name twice, that's just how cppreference rolls, don't @ me πŸŽ€ (this one lives in the C++ Standard Library, mwah)


✨ Synopsis ✨

const_iterator erase_after( const_iterator p );  (since C++20)

okay so what this icon does: it erases the std::chrono::tzdb that's referred to by the iterator following p. like, p itself is safe, it's the next one that gets yeeted 🫢

⚠️ heads up bestie β€” the behavior is undefined if that iterator is not dereferenceable. not "kinda weird", not "probably fine", undefined. do a vibe check on your iterator before you send it, fr fr πŸ’€

and the good news? no pointers, references, or iterators are invalidated except for the ones referring to the erased element. everything else stays valid, slay ✨


🌸 Return value 🌸

An iterator pointing to the element following the erased element πŸ’– …or end() if no such element exists. either way you get a thing back, no cap 🌈


πŸ¦‹ Notes πŸ¦‹

  • tzdb_list is intended to be implementable as a singly linked list, and its interface resembles that of std::forward_list. the family resemblance is real πŸ‘‘
  • but here's the catch: it has no before_begin(). 😭
  • and because of that, it is not possible to erase the first element. the first one is main character energy and simply cannot be removed, periodt πŸ’…

that's the whole page, you ate that πŸ’œβœ¨ source/version cppreference.com, dated 2024.06.10 β€” go forth and erase responsibly, bestie πŸ§šπŸ“

πŸ“¦ where this page comes from