@@ -44,7 +44,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
4444// generic implementation
4545template <class _Iter , class _Sent , class _Tp , class _Proj >
4646_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _Iter
47- __find (_Iter __first, _Sent __last, const _Tp& __value, _Proj& __proj) {
47+ __find (_Iter __first, _Sent __last, const _Tp& __value, _Proj&& __proj) {
4848 for (; __first != __last; ++__first)
4949 if (std::__invoke (__proj, *__first) == __value)
5050 break ;
@@ -88,7 +88,7 @@ template <class _Tp,
8888 is_signed<_Tp>::value == is_signed<_Up>::value,
8989 int > = 0 >
9090_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _Tp*
91- __find (_Tp* __first, _Tp* __last, const _Up& __value, _Proj& __proj) {
91+ __find (_Tp* __first, _Tp* __last, const _Up& __value, _Proj&& __proj) {
9292 if (__value < numeric_limits<_Tp>::min () || __value > numeric_limits<_Tp>::max ())
9393 return __last;
9494 return std::__find (__first, __last, _Tp (__value), __proj);
@@ -151,7 +151,7 @@ template <class _SegmentedIterator,
151151 class _Proj ,
152152 __enable_if_t <__is_segmented_iterator<_SegmentedIterator>::value, int > = 0 >
153153_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _SegmentedIterator
154- __find (_SegmentedIterator __first, _SegmentedIterator __last, const _Tp& __value, _Proj& __proj) {
154+ __find (_SegmentedIterator __first, _SegmentedIterator __last, const _Tp& __value, _Proj&& __proj) {
155155 return std::__find_segment_if (std::move (__first), std::move (__last), __find_segment<_Tp>(__value), __proj);
156156}
157157
0 commit comments