std::ranges...or::iterator(3)
π std::ranges::cartesian_product_view::iterator::iterator π
okay bestie, welcome to the C++ Standard Libary β yes, that's literally how it's spelled in the header, they forgot the r but we still slay π β section (3). this page is all about the iterator constructor, and it's giving deep template lore, but I got you. let's go π«Ά
πΈ NAME πΈ
std::ranges::cartesian_product_view::iterator::iterator β that's the whole name, periodt. it's the constructor for the iterator of cartesian_product_view. iconic.
β¨ SYNOPSIS β¨
okay so there are three constructors in the mix, and here's the exact code, no edits:
(1) β since C++23
/*iterator*/() = default;
(2) β since C++23
constexpr /*iterator*/( /*iterator*/<!Const> i )
requires Const && (
std::convertible_to<ranges::iterator_t<First>, ranges::iterator_t<const First>>
&& ... &&
std::convertible_to<ranges::iterator_t<Vs>, ranges::iterator_t<const Vs>>
);
(3) β private, exposition only*
private:
constexpr /*iterator*/(
/*Parent*/& parent,
std::tuple<ranges::iterator_t</*maybe-const*/<Const, First>>,
ranges::iterator_t</*maybe-const*/<Const, Vs>>...>
current );
π DESCRIPTION π
Construct an iterator. (that's the whole vibe, honestly)
- Default constructor. Value-initializes the
parent_withnullptrand default-initializes thecurrent_. lowkey simple, highkey necessary β¨. - Conversion from
/*iterator*/<false>to/*iterator*/<true>. Initializesparent_withi.parent_andcurrent_withstd::move(i.current_). it's giving glow-up from non-const to const, slay π. - A private constructor which is used by
cartesian_product_view::beginandcartesian_product_view::end. This constructor is not accessible to users. Initializesparent_withstd::addressof(parent)andcurrent_withstd::move(current). so it's for the view's own internal use only β bestie, don't touch, it's not for us π.
π PARAMETERS π
iβ an/*iterator*/<false>. that's the only parameter, and it's literally the non-const iterator you're converting from. cute.
π¦ EXAMPLE π¦
This section is incomplete Reason: no example
(ngl, the example section is empty. they said "no example" and that's the whole tea. π)
β CATEGORY β
- Todo no example
(yeah, it's a todo. the category is literally just "Todo no example". we love a work in progress π)
mwah π that's the page! source: http://cppreference.com, version 2024.06.10, and the page is std::ranges...or::iterator(3). stay iconic, bestie π«Άβ¨
π¦ where this page comes from
- nixpkgs unstable: stdman 2024.07.05
- opensuse-leap 16.0: stdman 2024.07.05-bp160.1.9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms