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

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

Okay bestie, welcome to the std::ranges...or::iterator(3) page from the C++ Standard Library β€” today’s main character is std::ranges::slide_view::iterator::iterator, and we’re getting into constructor lore. πŸ’…βœ¨

🌸 NAME 🌸

std::ranges::slide_view::iterator::iterator β€” std::ranges::slide_view::iterator::iterator

✨ Synopsis ✨

          /*iterator*/();                                               (1)
       (since C++23)
          constexpr /*iterator*/( /*iterator*/<!Const> i )

              requires Const &&                                         (2)
       (since C++23)

                  std::convertible_to<ranges::iterator_t<V>,
          ranges::iterator_t<Base>>
          private:

          constexpr /*iterator*/( ranges::iterator_t<Base> current,     (3)
       (exposition only*)
                                  ranges::range_difference_t<Base> n )

              requires (!/*slide-caches-first*/<Base>);
          private:

          constexpr /*iterator*/( ranges::iterator_t<Base> current,
                                  ranges::iterator_t<Base> last_ele,    (4)
       (exposition only*)
                                  ranges::range_difference_t<Base> n )

              requires /*slide-caches-first*/<Base>;

Construct an iterator. 🫢 Here’s the rundown, constructor by constructor:

  1. Default constructor. Value-initializes the underlying data members:
    • current_ with ranges::iterator_t<Base>(),
    • last_ele_ with ranges::iterator_t<Base>() (note that this member may not be present),
    • n_ with 0.
  2. Conversion from /*iterator*/<false> to /*iterator*/<true>. Initializes the underlying data members:
    • current_ with std::move(i.current_),
    • n_ with i.n_.

Note that /*iterator*/<true> can only be formed when Base models /*slide-caches-nothing*/, in which case last_ele_ is not present.

  1. A private constructor which is used by ranges::slide_view::begin and ranges::slide_view::end. This constructor is not accessible to users. It initializes the underlying data members:
    • current_ with current,
    • n_ with n.

Note that this overload can only be present if last_ele_ is not present. It’s also marked exposition only in the synopsis, bestie. πŸŽ€

  1. A private constructor which is used by ranges::slide_view::begin and ranges::slide_view::end. This constructor is not accessible to users. It initializes the underlying data members:
    • current_ with current,
    • last_ele_ with last_ele (note that this data member is present due to /*slide-caches-first*/<Base> requirement),
    • n_ with n.

It’s marked exposition only in the synopsis too. πŸ’…

🌈 Parameters 🌈

  • i β€” an /*iterator*/<false>
  • current β€” an iterator to current element of slide_view
  • last_ele β€” an iterator to last element of slide_view
  • n β€” the slide window width of slide_view

πŸ¦‹ Example πŸ¦‹

This section is incomplete.

Reason: no example 😭

πŸŽ€ Category πŸŽ€

  • Todo no example

Sourced from http://cppreference.com, dated 2024.06.10, and filed under std::ranges...or::iterator(3) β€” bye bestie, go slay those iterators! πŸ’–βœ¨πŸ«Ά

πŸ“¦ where this page comes from