Re: [PATCH] libstdc++: Implement ranges::cartesian_product_view from P2374R4

2022-11-07 Thread Jonathan Wakely via Gcc-patches
t<0>(__it) = > > __detail::__cartesian_common_arg_end(std::get<0>(_M_bases)); > > + return _Iterator{*this, std::move(__it)}; > > +} > > + > > +constexpr _Iterator > > + end() const requires __detail::__cartesian_product_is_common &

Re: [PATCH] libstdc++: Implement ranges::cartesian_product_view from P2374R4

2022-11-07 Thread Patrick Palka via Gcc-patches
_cartesian_product_is_common > _First, const _Vs...> > > +{ > > + bool __empty_tail = [this](index_sequence<_Is...>) { > > + return (ranges::empty(std::get<1 + _Is>(_M_bases)) || ...); > > + }(make_index_sequence{}); > > + > > +

Re: [PATCH] libstdc++: Implement ranges::cartesian_product_view from P2374R4

2022-10-27 Thread Patrick Palka via Gcc-patches
__it = __detail::__tuple_transform(ranges::begin, _M_bases); > + if (!__empty_tail) > + std::get<0>(__it) = > __detail::__cartesian_common_arg_end(std::get<0>(_M_bases)); > + return _Iterator{*this, std::move(__it)}; > +} > + > +constexpr

[PATCH] libstdc++: Implement ranges::cartesian_product_view from P2374R4

2022-10-27 Thread Patrick Palka via Gcc-patches
This also implements the proposed resolutions of the tentatively ready LWG issues 3760 and 3761. I'm not sure how/if we should implement the recommended practice of: difference_type should be the smallest signed-integer-like type that is sufficiently wide to store the product of the maximum s