std::forwar...before_begin(3)

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

πŸ’– NAME πŸ’–

okay so this is the C++ Standard Libary page for std::forwar...before_begin(3), and the main character is std::forward_list::before_begin,cbefore_begin β€” yep, exactly like that: std::forward_list::before_begin,cbefore_begin. 🫢

✨ Synopsis ✨

bestie, here’s the whole vibe β€” these are std::forward_list member functions:

          iterator before_begin() noexcept;               (since C++11)
          const_iterator before_begin() const noexcept;   (since C++11)
          const_iterator cbefore_begin() const noexcept;  (since C++11)

It returns an iterator to the element before the first element of the container. This element acts as a placeholder, and attempting to access it results in undefined behavior β€” so do not touch it, fr fr. 😭

The only usage cases are in the functions insert_after(), emplace_after(), erase_after(), splice_after() and the increment operator: incrementing the before-begin iterator gives exactly the same iterator as obtained from begin()/cbegin(). ✨

πŸŽ€ Parameters πŸŽ€

  • (none) β€” no args, no stress πŸ’…

πŸ’« Return value πŸ’«

Iterator to the element before the first element. That’s the whole return value, iconic. πŸ‘‘

⭐ Complexity ⭐

Constant. Easy peasy. ⚑

πŸ¦‹ Example πŸ¦‹

This section is incomplete.

Reason: no example. 😭

🌈 See also 🌈

  • begin β€” returns an iterator to the beginning
  • cbegin β€” (public member function)
  • end β€” returns an iterator to the end
  • cend β€” (public member function)

🏷️ Category 🏷️

  • * Todo no example

okay bestie that’s the whole thing πŸ’– sourced from http://cppreference.com, version/date 2024.06.10, page std::forwar...before_begin(3). Bye and slay your iterators responsibly! πŸŽ€

πŸ“¦ where this page comes from