Skip to content

Commit edc4860

Browse files
committed
fix of sample implementation
1 parent cbbdbf5 commit edc4860

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

reference/algorithm/ranges_search.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,11 +163,12 @@ struct search_impl {
163163
I2 p2 = first2;
164164
while (true) {
165165
if (p2 == last2) return {first1, p1};
166-
if (p1 == last1) return {last1, last1};
166+
if (p1 == last1) return {p1, p1};
167167
if (!invoke(pred, invoke(proj1, *p1), invoke(proj2, *p2))) break;
168168
++p1, ++p2;
169169
}
170-
}
170+
return {first1, first1};
171+
}
171172
}
172173

173174
template<forward_range R1, forward_range R2, class Pred = ranges::equal_to, class Proj1 = identity, class Proj2 = identity>

0 commit comments

Comments
 (0)