From Jason Turner

[alg.ends.with]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpubwvf8lv/{from.md → to.md} +39 -0
tmp/tmpubwvf8lv/{from.md → to.md} RENAMED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ### Ends with <a id="alg.ends.with">[[alg.ends.with]]</a>
2
+
3
+ ``` cpp
4
+ template<input_iterator I1, sentinel_for<I1> S1, input_iterator I2, sentinel_for<I2> S2,
5
+ class Pred = ranges::equal_to, class Proj1 = identity, class Proj2 = identity>
6
+ requires (forward_iterator<I1> || sized_sentinel_for<S1, I1>) &&
7
+ (forward_iterator<I2> || sized_sentinel_for<S2, I2>) &&
8
+ indirectly_comparable<I1, I2, Pred, Proj1, Proj2>
9
+ constexpr bool ranges::ends_with(I1 first1, S1 last1, I2 first2, S2 last2, Pred pred = {},
10
+ Proj1 proj1 = {}, Proj2 proj2 = {});
11
+ ```
12
+
13
+ Let `N1` be `last1 - first1` and `N2` be `last2 - first2`.
14
+
15
+ *Returns:* `false` if `N1` < `N2`, otherwise
16
+
17
+ ``` cpp
18
+ ranges::equal(std::move(first1) + (N1 - N2), last1, std::move(first2), last2,
19
+ pred, proj1, proj2)
20
+ ```
21
+
22
+ ``` cpp
23
+ template<input_range R1, input_range R2, class Pred = ranges::equal_to, class Proj1 = identity,
24
+ class Proj2 = identity>
25
+ requires (forward_range<R1> || sized_range<R1>) &&
26
+ (forward_range<R2> || sized_range<R2>) &&
27
+ indirectly_comparable<iterator_t<R1>, iterator_t<R2>, Pred, Proj1, Proj2>
28
+ constexpr bool ranges::ends_with(R1&& r1, R2&& r2, Pred pred = {},
29
+ Proj1 proj1 = {}, Proj2 proj2 = {});
30
+ ```
31
+
32
+ Let `N1` be `ranges::distance(r1)` and `N2` be `ranges::distance(r2)`.
33
+
34
+ *Returns:* `false` if `N1` < `N2`, otherwise
35
+
36
+ ``` cpp
37
+ ranges::equal(ranges::drop_view(ranges::ref_view(r1), N1 - N2), r2, pred, proj1, proj2)
38
+ ```
39
+