std::ranges...or::iterator(3)

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

πŸ’– NAME πŸ’–

okay bestie, this page is about std::ranges::enumerate_view::iterator::iterator β€” and the NAME line literally says std::ranges::enumerate_view::iterator::iterator twice, which is giving "I have main character energy and also a long name" πŸ’…. The header abbreviates it as std::ranges...or::iterator(3), and this is from the C++ Standard Libary manual, section 3. Lock in. ✨

✨ Synopsis ✨

here's the synopsis, no cap:

/*iterator*/()
    requires std::default_initializable<ranges::iterator_t<Base>> (1)
    (since C++23)
= default;

constexpr /*iterator*/( /*iterator*/<!Const> i )
    requires Const &&
             std::convertible_to<ranges::iterator_t<V>,
                                 ranges::iterator_t<Base>>; (2)
    (since C++23)

private:
constexpr explicit /*iterator*/( ranges::iterator_t<Base> current,
                                 difference_type pos); (3)
    (exposition only*)

Construct an iterator. 🫢

🌸 Parameters 🌸

  • i β€” an /*iterator*/<false>. that's the whole parameter list, bestie. πŸŽ€

πŸ¦‹ Constructors / Description πŸ¦‹

  1. Default constructor. Value-initializes the underlying iterator current_ with ranges::iterator_t<Base>() and the underlying index pos_ with 0. cute, clean, zeroed out. ✨
  2. Conversion from /*iterator*/<false> to /*iterator*/<true>. Initializes current_ with std::move(i.current_) and pos_ with i.pos_. yes, it's moving things, we love a transfer of energy. πŸ’«
  3. A private constructor which is used by enumerate_view::begin and enumerate_view::end. This constructor is not accessible to users β€” hands off, bestie. πŸ™ˆ It initializes current_ with std::move(current) and pos_ with pos.

πŸŽ€ Example πŸŽ€

This section is incomplete Reason: no example

🌈 Category 🌈

  • * Todo no example

cute little sign-off: source is http://cppreference.com, version/date is 2024.06.10. bye bestie, go construct some iterators responsibly πŸ’–βœ¨

πŸ“¦ where this page comes from