Lines Matching defs:__first

36     _Iter __first, _Sent __last, _SizeT __count, const _Type& __value, _Pred& __pred, _Proj& __proj) {
38 return std::make_pair(__first, __first);
42 if (__first == __last) { // return __last if no element matches __value
43 _IterOps<_AlgPolicy>::__advance_to(__first, __last);
44 return std::make_pair(__first, __first);
46 if (std::__invoke(__pred, std::__invoke(__proj, *__first), __value))
48 ++__first;
50 // *__first matches __value, now match elements after here
51 _Iter __m = __first;
54 if (++__c == __count) // If pattern exhausted, __first is the answer (works for 1 element pattern)
55 return std::make_pair(__first, ++__m);
57 _IterOps<_AlgPolicy>::__advance_to(__first, __last);
58 return std::make_pair(__first, __first);
61 // if there is a mismatch, restart with a new __first
63 __first = __m;
64 ++__first;
73 _Iter __first, _Sent __last, _SizeT __count, const _Type& __value, _Pred& __pred, _Proj& __proj, _DiffT __size1) {
76 return std::make_pair(__first, __first);
78 _IterOps<_AlgPolicy>::__advance_to(__first, __last);
79 return std::make_pair(__first, __first);
82 const auto __s = __first + __size1 - difference_type(__count - 1); // Start of pattern match can't go beyond here
86 if (__first >= __s) { // return __last if no element matches __value
87 _IterOps<_AlgPolicy>::__advance_to(__first, __last);
88 return std::make_pair(__first, __first);
90 if (std::__invoke(__pred, std::__invoke(__proj, *__first), __value))
92 ++__first;
94 // *__first matches __value_, now match elements after here
95 auto __m = __first;
98 if (++__c == __count) // If pattern exhausted, __first is the answer (works for 1 element pattern)
99 return std::make_pair(__first, __first + _DiffT(__count));
102 // if there is a mismatch, restart with a new __first
104 __first = __m;
105 ++__first;
120 __search_n_impl(_Iter __first, _Sent __last, _DiffT __count, const _Type& __value, _Pred& __pred, _Proj& __proj) {
122 __first, __last, __count, __value, __pred, __proj, __last - __first);
135 __search_n_impl(_Iter1 __first, _Sent1 __last, _DiffT __count, const _Type& __value, _Pred& __pred, _Proj& __proj) {
136 return std::__search_n_forward_impl<_ClassicAlgPolicy>(__first, __last, __count, __value, __pred, __proj);
141 _ForwardIterator __first, _ForwardIterator __last, _Size __count, const _Tp& __value, _BinaryPredicate __pred) {
143 __is_callable<_BinaryPredicate&, decltype(*__first), const _Tp&>::value, "The comparator has to be callable");
145 return std::__search_n_impl(__first, __last, std::__convert_to_integral(__count), __value, __pred, __proj).first;
150 search_n(_ForwardIterator __first, _ForwardIterator __last, _Size __count, const _Tp& __value) {
151 return std::search_n(__first, __last, std::__convert_to_integral(__count), __value, __equal_to());