From Jason Turner

[set.symmetric.difference]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmprs_cq3s_/{from.md → to.md} +37 -11
tmp/tmprs_cq3s_/{from.md → to.md} RENAMED
@@ -1,11 +1,11 @@
1
  #### `set_symmetric_difference` <a id="set.symmetric.difference">[[set.symmetric.difference]]</a>
2
 
3
  ``` cpp
4
  template<class InputIterator1, class InputIterator2,
5
  class OutputIterator>
6
- OutputIterator
7
  set_symmetric_difference(InputIterator1 first1, InputIterator1 last1,
8
  InputIterator2 first2, InputIterator2 last2,
9
  OutputIterator result);
10
  template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2,
11
  class ForwardIterator>
@@ -15,39 +15,65 @@ template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2,
15
  ForwardIterator2 first2, ForwardIterator2 last2,
16
  ForwardIterator result);
17
 
18
  template<class InputIterator1, class InputIterator2,
19
  class OutputIterator, class Compare>
20
- OutputIterator
21
  set_symmetric_difference(InputIterator1 first1, InputIterator1 last1,
22
  InputIterator2 first2, InputIterator2 last2,
23
  OutputIterator result, Compare comp);
24
  template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2,
25
  class ForwardIterator, class Compare>
26
  ForwardIterator
27
  set_symmetric_difference(ExecutionPolicy&& exec,
28
  ForwardIterator1 first1, ForwardIterator1 last1,
29
  ForwardIterator2 first2, ForwardIterator2 last2,
30
  ForwardIterator result, Compare comp);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31
  ```
32
 
33
- *Requires:* The resulting range shall not overlap with either of the
 
 
 
 
 
34
  original ranges.
35
 
36
  *Effects:* Copies the elements of the range \[`first1`, `last1`) that
37
  are not present in the range \[`first2`, `last2`), and the elements of
38
  the range \[`first2`, `last2`) that are not present in the range
39
  \[`first1`, `last1`) to the range beginning at `result`. The elements in
40
  the constructed range are sorted.
41
 
42
- *Returns:* The end of the constructed range.
 
 
 
 
43
 
44
  *Complexity:* At most `2 * ((last1 - first1) + (last2 - first2)) - 1`
45
- comparisons.
46
 
47
- *Remarks:* If \[`first1`, `last1`) contains m elements that are
48
- equivalent to each other and \[`first2`, `last2`) contains n elements
49
- that are equivalent to them, then |m - n| of those elements shall be
50
- copied to the output range: the last m - n of these elements from
51
- \[`first1`, `last1`) if m > n, and the last n - m of these elements from
52
- \[`first2`, `last2`) if m < n.
 
53
 
 
1
  #### `set_symmetric_difference` <a id="set.symmetric.difference">[[set.symmetric.difference]]</a>
2
 
3
  ``` cpp
4
  template<class InputIterator1, class InputIterator2,
5
  class OutputIterator>
6
+ constexpr OutputIterator
7
  set_symmetric_difference(InputIterator1 first1, InputIterator1 last1,
8
  InputIterator2 first2, InputIterator2 last2,
9
  OutputIterator result);
10
  template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2,
11
  class ForwardIterator>
 
15
  ForwardIterator2 first2, ForwardIterator2 last2,
16
  ForwardIterator result);
17
 
18
  template<class InputIterator1, class InputIterator2,
19
  class OutputIterator, class Compare>
20
+ constexpr OutputIterator
21
  set_symmetric_difference(InputIterator1 first1, InputIterator1 last1,
22
  InputIterator2 first2, InputIterator2 last2,
23
  OutputIterator result, Compare comp);
24
  template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2,
25
  class ForwardIterator, class Compare>
26
  ForwardIterator
27
  set_symmetric_difference(ExecutionPolicy&& exec,
28
  ForwardIterator1 first1, ForwardIterator1 last1,
29
  ForwardIterator2 first2, ForwardIterator2 last2,
30
  ForwardIterator result, Compare comp);
31
+
32
+ template<input_iterator I1, sentinel_for<I1> S1, input_iterator I2, sentinel_for<I2> S2,
33
+ weakly_incrementable O, class Comp = ranges::less,
34
+ class Proj1 = identity, class Proj2 = identity>
35
+ requires mergeable<I1, I2, O, Comp, Proj1, Proj2>
36
+ constexpr ranges::set_symmetric_difference_result<I1, I2, O>
37
+ ranges::set_symmetric_difference(I1 first1, S1 last1, I2 first2, S2 last2, O result,
38
+ Comp comp = {}, Proj1 proj1 = {},
39
+ Proj2 proj2 = {});
40
+ template<input_range R1, input_range R2, weakly_incrementable O,
41
+ class Comp = ranges::less, class Proj1 = identity, class Proj2 = identity>
42
+ requires mergeable<iterator_t<R1>, iterator_t<R2>, O, Comp, Proj1, Proj2>
43
+ constexpr ranges::set_symmetric_difference_result<borrowed_iterator_t<R1>,
44
+ borrowed_iterator_t<R2>, O>
45
+ ranges::set_symmetric_difference(R1&& r1, R2&& r2, O result, Comp comp = {},
46
+ Proj1 proj1 = {}, Proj2 proj2 = {});
47
  ```
48
 
49
+ Let `comp` be `less{}`, and `proj1` and `proj2` be `identity{}` for the
50
+ overloads with no parameters by those names.
51
+
52
+ *Preconditions:* The ranges \[`first1`, `last1`) and \[`first2`,
53
+ `last2`) are sorted with respect to `comp` and `proj1` or `proj2`,
54
+ respectively. The resulting range does not overlap with either of the
55
  original ranges.
56
 
57
  *Effects:* Copies the elements of the range \[`first1`, `last1`) that
58
  are not present in the range \[`first2`, `last2`), and the elements of
59
  the range \[`first2`, `last2`) that are not present in the range
60
  \[`first1`, `last1`) to the range beginning at `result`. The elements in
61
  the constructed range are sorted.
62
 
63
+ *Returns:* Let `result_last` be the end of the constructed range.
64
+ Returns
65
+
66
+ - `result_last` for the overloads in namespace `std`.
67
+ - `{last1, last2, result_last}` for the overloads in namespace `ranges`.
68
 
69
  *Complexity:* At most `2 * ((last1 - first1) + (last2 - first2)) - 1`
70
+ comparisons and applications of each projection.
71
 
72
+ *Remarks:* Stable [[algorithm.stable]]. If \[`first1`, `last1`) contains
73
+ m elements that are equivalent to each other and \[`first2`, `last2`)
74
+ contains n elements that are equivalent to them, then |m - n| of those
75
+ elements shall be copied to the output range: the last m - n of these
76
+ elements from \[`first1`, `last1`) if m > n, and the last n - m of these
77
+ elements from \[`first2`, `last2`) if m < n. In either case, the
78
+ elements are copied in order.
79