From Jason Turner

[includes]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmplr06rdtu/{from.md → to.md} +29 -6
tmp/tmplr06rdtu/{from.md → to.md} RENAMED
@@ -1,29 +1,52 @@
1
  #### `includes` <a id="includes">[[includes]]</a>
2
 
3
  ``` cpp
4
  template<class InputIterator1, class InputIterator2>
5
- bool includes(InputIterator1 first1, InputIterator1 last1,
6
  InputIterator2 first2, InputIterator2 last2);
7
  template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2>
8
  bool includes(ExecutionPolicy&& exec,
9
  ForwardIterator1 first1, ForwardIterator1 last1,
10
  ForwardIterator2 first2, ForwardIterator2 last2);
11
 
12
  template<class InputIterator1, class InputIterator2, class Compare>
13
- bool includes(InputIterator1 first1, InputIterator1 last1,
14
  InputIterator2 first2, InputIterator2 last2,
15
  Compare comp);
16
  template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2, class Compare>
17
  bool includes(ExecutionPolicy&& exec,
18
  ForwardIterator1 first1, ForwardIterator1 last1,
19
  ForwardIterator2 first2, ForwardIterator2 last2,
20
  Compare comp);
 
 
 
 
 
 
 
 
 
 
 
 
 
21
  ```
22
 
23
- *Returns:* `true` if \[`first2`, `last2`) is empty or if every element
24
- in the range \[`first2`, `last2`) is contained in the range \[`first1`,
25
- `last1`). Returns `false` otherwise.
 
 
 
 
 
 
 
 
 
 
26
 
27
  *Complexity:* At most `2 * ((last1 - first1) + (last2 - first2)) - 1`
28
- comparisons.
29
 
 
1
  #### `includes` <a id="includes">[[includes]]</a>
2
 
3
  ``` cpp
4
  template<class InputIterator1, class InputIterator2>
5
+ constexpr bool includes(InputIterator1 first1, InputIterator1 last1,
6
  InputIterator2 first2, InputIterator2 last2);
7
  template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2>
8
  bool includes(ExecutionPolicy&& exec,
9
  ForwardIterator1 first1, ForwardIterator1 last1,
10
  ForwardIterator2 first2, ForwardIterator2 last2);
11
 
12
  template<class InputIterator1, class InputIterator2, class Compare>
13
+ constexpr bool includes(InputIterator1 first1, InputIterator1 last1,
14
  InputIterator2 first2, InputIterator2 last2,
15
  Compare comp);
16
  template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2, class Compare>
17
  bool includes(ExecutionPolicy&& exec,
18
  ForwardIterator1 first1, ForwardIterator1 last1,
19
  ForwardIterator2 first2, ForwardIterator2 last2,
20
  Compare comp);
21
+
22
+ template<input_iterator I1, sentinel_for<I1> S1, input_iterator I2, sentinel_for<I2> S2,
23
+ class Proj1 = identity, class Proj2 = identity,
24
+ indirect_strict_weak_order<projected<I1, Proj1>,
25
+ projected<I2, Proj2>> Comp = ranges::less>
26
+ constexpr bool ranges::includes(I1 first1, S1 last1, I2 first2, S2 last2, Comp comp = {},
27
+ Proj1 proj1 = {}, Proj2 proj2 = {});
28
+ template<input_range R1, input_range R2, class Proj1 = identity,
29
+ class Proj2 = identity,
30
+ indirect_strict_weak_order<projected<iterator_t<R1>, Proj1>,
31
+ projected<iterator_t<R2>, Proj2>> Comp = ranges::less>
32
+ constexpr bool ranges::includes(R1&& r1, R2&& r2, Comp comp = {},
33
+ Proj1 proj1 = {}, Proj2 proj2 = {});
34
  ```
35
 
36
+ Let `comp` be `less{}`, `proj1` be `identity{}`, and `proj2` be
37
+ `identity{}`, for the overloads with no parameters by those names.
38
+
39
+ *Preconditions:* The ranges \[`first1`, `last1`) and \[`first2`,
40
+ `last2`) are sorted with respect to `comp` and `proj1` or `proj2`,
41
+ respectively.
42
+
43
+ *Returns:* `true` if and only if \[`first2`, `last2`) is a subsequence
44
+ of \[`first1`, `last1`).
45
+
46
+ [*Note 1*: A sequence S is a subsequence of another sequence T if S can
47
+ be obtained from T by removing some, all, or none of T’s elements and
48
+ keeping the remaining elements in the same order. — *end note*]
49
 
50
  *Complexity:* At most `2 * ((last1 - first1) + (last2 - first2)) - 1`
51
+ comparisons and applications of each projection.
52