From Jason Turner

[alg.remove]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpu80e3fsn/{from.md → to.md} +27 -4
tmp/tmpu80e3fsn/{from.md → to.md} RENAMED
@@ -2,18 +2,26 @@
2
 
3
  ``` cpp
4
  template<class ForwardIterator, class T>
5
  ForwardIterator remove(ForwardIterator first, ForwardIterator last,
6
  const T& value);
 
 
 
 
7
 
8
  template<class ForwardIterator, class Predicate>
9
  ForwardIterator remove_if(ForwardIterator first, ForwardIterator last,
10
  Predicate pred);
 
 
 
 
11
  ```
12
 
13
  *Requires:* The type of `*first` shall satisfy the `MoveAssignable`
14
- requirements (Table  [[moveassignable]]).
15
 
16
  *Effects:* Eliminates all the elements referred to by iterator `i` in
17
  the range \[`first`, `last`) for which the following corresponding
18
  conditions hold: `*i == value, pred(*i) != false`.
19
 
@@ -22,31 +30,46 @@ conditions hold: `*i == value, pred(*i) != false`.
22
  *Remarks:* Stable ([[algorithm.stable]]).
23
 
24
  *Complexity:* Exactly `last - first` applications of the corresponding
25
  predicate.
26
 
27
- *Note:* each element in the range \[`ret`, `last`), where `ret` is the
28
- returned value, has a valid but unspecified state, because the
29
  algorithms can eliminate elements by moving from elements that were
30
- originally in that range.
31
 
32
  ``` cpp
33
  template<class InputIterator, class OutputIterator, class T>
34
  OutputIterator
35
  remove_copy(InputIterator first, InputIterator last,
36
  OutputIterator result, const T& value);
 
 
 
 
 
37
 
38
  template<class InputIterator, class OutputIterator, class Predicate>
39
  OutputIterator
40
  remove_copy_if(InputIterator first, InputIterator last,
41
  OutputIterator result, Predicate pred);
 
 
 
 
 
42
  ```
43
 
44
  *Requires:* The ranges \[`first`, `last`) and \[`result`,
45
  `result + (last - first)`) shall not overlap. The expression
46
  `*result = *first` shall be valid.
47
 
 
 
 
 
 
48
  *Effects:* Copies all the elements referred to by the iterator `i` in
49
  the range \[`first`, `last`) for which the following corresponding
50
  conditions do not hold: `*i == value, pred(*i) != false`.
51
 
52
  *Returns:* The end of the resulting range.
 
2
 
3
  ``` cpp
4
  template<class ForwardIterator, class T>
5
  ForwardIterator remove(ForwardIterator first, ForwardIterator last,
6
  const T& value);
7
+ template<class ExecutionPolicy, class ForwardIterator, class T>
8
+ ForwardIterator remove(ExecutionPolicy&& exec,
9
+ ForwardIterator first, ForwardIterator last,
10
+ const T& value);
11
 
12
  template<class ForwardIterator, class Predicate>
13
  ForwardIterator remove_if(ForwardIterator first, ForwardIterator last,
14
  Predicate pred);
15
+ template<class ExecutionPolicy, class ForwardIterator, class Predicate>
16
+ ForwardIterator remove_if(ExecutionPolicy&& exec,
17
+ ForwardIterator first, ForwardIterator last,
18
+ Predicate pred);
19
  ```
20
 
21
  *Requires:* The type of `*first` shall satisfy the `MoveAssignable`
22
+ requirements (Table  [[tab:moveassignable]]).
23
 
24
  *Effects:* Eliminates all the elements referred to by iterator `i` in
25
  the range \[`first`, `last`) for which the following corresponding
26
  conditions hold: `*i == value, pred(*i) != false`.
27
 
 
30
  *Remarks:* Stable ([[algorithm.stable]]).
31
 
32
  *Complexity:* Exactly `last - first` applications of the corresponding
33
  predicate.
34
 
35
+ [*Note 1*: Each element in the range \[`ret`, `last`), where `ret` is
36
+ the returned value, has a valid but unspecified state, because the
37
  algorithms can eliminate elements by moving from elements that were
38
+ originally in that range. — *end note*]
39
 
40
  ``` cpp
41
  template<class InputIterator, class OutputIterator, class T>
42
  OutputIterator
43
  remove_copy(InputIterator first, InputIterator last,
44
  OutputIterator result, const T& value);
45
+ template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2, class T>
46
+ ForwardIterator2
47
+ remove_copy(ExecutionPolicy&& exec,
48
+ ForwardIterator1 first, ForwardIterator1 last,
49
+ ForwardIterator2 result, const T& value);
50
 
51
  template<class InputIterator, class OutputIterator, class Predicate>
52
  OutputIterator
53
  remove_copy_if(InputIterator first, InputIterator last,
54
  OutputIterator result, Predicate pred);
55
+ template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2, class Predicate>
56
+ ForwardIterator2
57
+ remove_copy_if(ExecutionPolicy&& exec,
58
+ ForwardIterator1 first, ForwardIterator1 last,
59
+ ForwardIterator2 result, Predicate pred);
60
  ```
61
 
62
  *Requires:* The ranges \[`first`, `last`) and \[`result`,
63
  `result + (last - first)`) shall not overlap. The expression
64
  `*result = *first` shall be valid.
65
 
66
+ [*Note 2*: For the overloads with an `ExecutionPolicy`, there may be a
67
+ performance cost if `iterator_traits<ForwardIterator1>::value_type` is
68
+ not `MoveConstructible`
69
+ (Table  [[tab:moveconstructible]]). — *end note*]
70
+
71
  *Effects:* Copies all the elements referred to by the iterator `i` in
72
  the range \[`first`, `last`) for which the following corresponding
73
  conditions do not hold: `*i == value, pred(*i) != false`.
74
 
75
  *Returns:* The end of the resulting range.