From Jason Turner

[alg.contains]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpf4a1f01p/{from.md → to.md} +30 -0
tmp/tmpf4a1f01p/{from.md → to.md} RENAMED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ### Contains <a id="alg.contains">[[alg.contains]]</a>
2
+
3
+ ``` cpp
4
+ template<input_iterator I, sentinel_for<I> S, class T, class Proj = identity>
5
+ requires indirect_binary_predicate<ranges::equal_to, projected<I, Proj>, const T*>
6
+ constexpr bool ranges::contains(I first, S last, const T& value, Proj proj = {});
7
+ template<input_range R, class T, class Proj = identity>
8
+ requires indirect_binary_predicate<ranges::equal_to, projected<iterator_t<R>, Proj>, const T*>
9
+ constexpr bool ranges::contains(R&& r, const T& value, Proj proj = {});
10
+ ```
11
+
12
+ *Returns:* `ranges::find(std::move(first), last, value, proj) != last`.
13
+
14
+ ``` cpp
15
+ template<forward_iterator I1, sentinel_for<I1> S1,
16
+ forward_iterator I2, sentinel_for<I2> S2,
17
+ class Pred = ranges::equal_to, class Proj1 = identity, class Proj2 = identity>
18
+ requires indirectly_comparable<I1, I2, Pred, Proj1, Proj2>
19
+ constexpr bool ranges::contains_subrange(I1 first1, S1 last1, I2 first2, S2 last2,
20
+ Pred pred = {}, Proj1 proj1 = {}, Proj2 proj2 = {});
21
+ template<forward_range R1, forward_range R2,
22
+ class Pred = ranges::equal_to, class Proj1 = identity, class Proj2 = identity>
23
+ requires indirectly_comparable<iterator_t<R1>, iterator_t<R2>, Pred, Proj1, Proj2>
24
+ constexpr bool ranges::contains_subrange(R1&& r1, R2&& r2, Pred pred = {},
25
+ Proj1 proj1 = {}, Proj2 proj2 = {});
26
+ ```
27
+
28
+ *Returns:*
29
+ `first2 == last2 || !ranges::search(first1, last1, first2, last2, pred, proj1, proj2).empty()`.
30
+