Re: [PATCH] libstdc++: extraneous begin in cartesian_product_view::end [PR107572]

2023-03-09 Thread Jonathan Wakely via Gcc-patches
e(__first_it), > > + ranges::begin(std::get<1 + > > _Is>(_M_bases))...); > > + else > > + return std::make_tuple(std::move(__first_it), > > + ranges::begin(std::get<1 + > > _Is>(_M_

Re: [PATCH] libstdc++: extraneous begin in cartesian_product_view::end [PR107572]

2023-03-07 Thread Patrick Palka via Gcc-patches
or_pair_t here instead of manually determining whether to use a pair or tuple, so that we don't forget to adjust this site when implementing P2165R4 (which removes __tuple_or_pair_t): -- >8 -- Subject: [PATCH] libstdc++: extraneous begin in cartesian_product_view::end [PR107572] ranges::begin() isn't g

[PATCH] libstdc++: extraneous begin in cartesian_product_view::end [PR107572]

2023-03-07 Thread Patrick Palka via Gcc-patches
ranges::begin() isn't guaranteed to be equality-preserving for non-forward ranges, so in cartesian_product_view::end we need to be careful about calling begin() on the first range (which could be non-forward) in the (non-degenerate) case where __empty_tail is false. Since we're already using a