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

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

🌸 NAME 🌸

std::ranges::transform_view::iterator::iterator β€” bestie, it's the constructor of the iterator of std::ranges::transform_view::iterator. Say that five times fast, iykyk πŸ’…


✨ Synopsis ✨

Ok so there are three of these bad boys, and they're all constexpr coded (except the first line as shown, don't come for me, I'm transcribing exactly). All of them are since C++20, slay ✨

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

constexpr /*iterator*/( Parent& parent, ranges::iterator_t<Base> current );   (2) (since C++20)

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

Construct an iterator. That's literally the whole vibe 🫢

  1. Default constructor. Value-initializes the underlying iterator, and initializes the pointer to parent transform_view with nullptr. Clean slate energy, no notes πŸ’€
  2. Initializes the underlying iterator with std::move(current), and the pointer to parent with std::addressof(parent). Giving it a home and a place to belong, we love to see it πŸ₯Ή
  3. Conversion from /*iterator*/<false> to /*iterator*/<true>. Move constructs corresponding members. Glow-up arc, main character energy πŸ‘‘

πŸŽ€ Parameters πŸŽ€

  • parent β€” a (possibly const-qualified) std::ranges::transform_view
  • current β€” an iterator into (possibly const-qualified) V
  • i β€” an /*iterator*/<false>

πŸ’– Example πŸ’–

This section is incomplete Reason: no example

Not me showing up with zero example 😭 the page literally says it's incomplete. We'll get 'em next time, fr fr πŸ™ˆ


⭐ Category ⭐

  • Todo: no example

Lowkey the whole todo list is just "add an example" and honestly? Same. πŸ“


And that's the whole page, bestie β€” no cap, every flag, every signature, every parameter, all accounted for πŸ’œ

Source: http://cppreference.com Β· version/date 2024.06.10 Β· filed under std::ranges...or::iterator(3) πŸŽ€βœ¨πŸ¦‹

πŸ“¦ where this page comes from