From Jason Turner

[set.difference]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmptxy3k5m4/{from.md → to.md} +35 -8
tmp/tmptxy3k5m4/{from.md → to.md} RENAMED
@@ -40,29 +40,56 @@ template<input_range R1, input_range R2, weakly_incrementable O,
40
  class Comp = ranges::less, class Proj1 = identity, class Proj2 = identity>
41
  requires mergeable<iterator_t<R1>, iterator_t<R2>, O, Comp, Proj1, Proj2>
42
  constexpr ranges::set_difference_result<borrowed_iterator_t<R1>, O>
43
  ranges::set_difference(R1&& r1, R2&& r2, O result,
44
  Comp comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {});
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
45
  ```
46
 
47
- Let `comp` be `less{}`, and `proj1` and `proj2` be `identity{}` for the
48
- overloads with no parameters by those names.
 
 
 
 
 
 
 
49
 
50
  *Preconditions:* The ranges \[`first1`, `last1`) and \[`first2`,
51
  `last2`) are sorted with respect to `comp` and `proj1` or `proj2`,
52
  respectively. The resulting range does not overlap with either of the
53
  original ranges.
54
 
55
- *Effects:* Copies the elements of the range \[`first1`, `last1`) which
56
- are not present in the range \[`first2`, `last2`) to the range beginning
57
- at `result`. The elements in the constructed range are sorted.
58
 
59
- *Returns:* Let `result_last` be the end of the constructed range.
60
- Returns
61
 
62
  - `result_last` for the overloads in namespace `std`.
63
- - `{last1, result_last}` for the overloads in namespace `ranges`.
 
 
 
 
64
 
65
  *Complexity:* At most `2 * ((last1 - first1) + (last2 - first2)) - 1`
66
  comparisons and applications of each projection.
67
 
68
  *Remarks:* If \[`first1`, `last1`) contains m elements that are
 
40
  class Comp = ranges::less, class Proj1 = identity, class Proj2 = identity>
41
  requires mergeable<iterator_t<R1>, iterator_t<R2>, O, Comp, Proj1, Proj2>
42
  constexpr ranges::set_difference_result<borrowed_iterator_t<R1>, O>
43
  ranges::set_difference(R1&& r1, R2&& r2, O result,
44
  Comp comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {});
45
+
46
+ template<execution-policy Ep, random_access_iterator I1, sized_sentinel_for<I1> S1,
47
+ random_access_iterator I2, sized_sentinel_for<I2> S2,
48
+ random_access_iterator O, sized_sentinel_for<O> OutS, class Comp = ranges::less,
49
+ class Proj1 = identity, class Proj2 = identity>
50
+ requires mergeable<I1, I2, O, Comp, Proj1, Proj2>
51
+ ranges::set_difference_result<I1, O>
52
+ ranges::set_difference(Ep&& exec, I1 first1, S1 last1,
53
+ I2 first2, S2 last2, O result, OutS result_last,
54
+ Comp comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {});
55
+ template<execution-policy Ep, sized-random-access-range R1, sized-random-access-range R2,
56
+ sized-random-access-range OutR, class Comp = ranges::less,
57
+ class Proj1 = identity, class Proj2 = identity>
58
+ requires mergeable<iterator_t<R1>, iterator_t<R2>, iterator_t<OutR>, Comp, Proj1, Proj2>
59
+ ranges::set_difference_result<borrowed_iterator_t<R1>, borrowed_iterator_t<OutR>>
60
+ ranges::set_difference(Ep&& exec, R1&& r1, R2&& r2, OutR&& result_r, Comp comp = {},
61
+ Proj1 proj1 = {}, Proj2 proj2 = {});
62
  ```
63
 
64
+ Let:
65
+
66
+ - `comp` be `less{}`, and `proj1` and `proj2` be `identity{}` for the
67
+ overloads with no parameters by those names;
68
+ - M be the number of elements in \[`first1`, `last1`) that are not
69
+ present in \[`first2`, `last2`);
70
+ - `result_last` be `result + `M for the overloads with no parameter
71
+ `result_last` or `result_r`;
72
+ - N be min(M, `result_last - result`).
73
 
74
  *Preconditions:* The ranges \[`first1`, `last1`) and \[`first2`,
75
  `last2`) are sorted with respect to `comp` and `proj1` or `proj2`,
76
  respectively. The resulting range does not overlap with either of the
77
  original ranges.
78
 
79
+ *Effects:* Copies N elements of the range \[`first1`, `last1`) which are
80
+ not present in the range \[`first2`, `last2`) to the range \[`result`,
81
+ `result + `N). The elements in the constructed range are sorted.
82
 
83
+ *Returns:*
 
84
 
85
  - `result_last` for the overloads in namespace `std`.
86
+ - `{last1, result + `N`}` for the overloads in namespace `ranges`, if N
87
+ is equal to M.
88
+ - Otherwise, `{j1, result_last}` for the overloads in namespace
89
+ `ranges`, where the iterator `j1` points to the position past the last
90
+ copied or skipped element in \[`first1`, `last1`).
91
 
92
  *Complexity:* At most `2 * ((last1 - first1) + (last2 - first2)) - 1`
93
  comparisons and applications of each projection.
94
 
95
  *Remarks:* If \[`first1`, `last1`) contains m elements that are