Re: [PATCH 1/3] libstdc++: Implement ranges::contains/contains_subrange from P2302R4

2022-11-14 Thread Jonathan Wakely via Gcc-patches
gt; + operator()(_Iter __first, _Sent __last, const _Tp& __value, _Proj > > > __proj = {}) const > > > + { return ranges::find(std::move(__first), __last, __value, __proj) > > > != __last; } > > > > Should this use std::move(__proj)? > > Oo

Re: [PATCH 1/3] libstdc++: Implement ranges::contains/contains_subrange from P2302R4

2022-11-14 Thread Patrick Palka via Gcc-patches
_Tp*> > > + constexpr bool > > + operator()(_Iter __first, _Sent __last, const _Tp& __value, _Proj > > __proj = {}) const > > + { return ranges::find(std::move(__first), __last, __value, __proj) > > != __last; } > > Should this use std::move(__

Re: [PATCH 1/3] libstdc++: Implement ranges::contains/contains_subrange from P2302R4

2022-11-14 Thread Jonathan Wakely via Gcc-patches
On Mon, 14 Nov 2022 at 04:51, Patrick Palka via Libstdc++ wrote: > > Tested on x86_64-pc-linux-gnu, does this look OK for trunk? > > libstdc++-v3/ChangeLog: > > * include/bits/ranges_algo.h (__contains_fn, contains): Define. > (__contains_subrange_fn, contains_subrange): Define. >

[PATCH 1/3] libstdc++: Implement ranges::contains/contains_subrange from P2302R4

2022-11-13 Thread Patrick Palka via Gcc-patches
Tested on x86_64-pc-linux-gnu, does this look OK for trunk? libstdc++-v3/ChangeLog: * include/bits/ranges_algo.h (__contains_fn, contains): Define. (__contains_subrange_fn, contains_subrange): Define. * testsuite/25_algorithms/contains/1.cc: New test. *