From Jason Turner

[alg.replace]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmp4xpwlp_1/{from.md → to.md} +24 -2
tmp/tmp4xpwlp_1/{from.md → to.md} RENAMED
@@ -2,14 +2,22 @@
2
 
3
  ``` cpp
4
  template<class ForwardIterator, class T>
5
  void replace(ForwardIterator first, ForwardIterator last,
6
  const T& old_value, const T& new_value);
 
 
 
 
7
 
8
  template<class ForwardIterator, class Predicate, class T>
9
  void replace_if(ForwardIterator first, ForwardIterator last,
10
  Predicate pred, const T& new_value);
 
 
 
 
11
  ```
12
 
13
  *Requires:* The expression `*first = new_value` shall be valid.
14
 
15
  *Effects:* Substitutes elements referred by the iterator `i` in the
@@ -23,21 +31,35 @@ predicate.
23
  template<class InputIterator, class OutputIterator, class T>
24
  OutputIterator
25
  replace_copy(InputIterator first, InputIterator last,
26
  OutputIterator result,
27
  const T& old_value, const T& new_value);
 
 
 
 
 
 
28
 
29
  template<class InputIterator, class OutputIterator, class Predicate, class T>
30
  OutputIterator
31
  replace_copy_if(InputIterator first, InputIterator last,
32
  OutputIterator result,
33
  Predicate pred, const T& new_value);
 
 
 
 
 
 
 
34
  ```
35
 
36
  *Requires:* The results of the expressions `*first` and `new_value`
37
- shall be writable to the `result` output iterator. The ranges \[`first`,
38
- `last`) and \[`result`, `result + (last - first)`) shall not overlap.
 
39
 
40
  *Effects:* Assigns to every iterator `i` in the range \[`result`,
41
  `result + (last - first)`) either `new_value` or
42
  `*(first + (i - result))` depending on whether the following
43
  corresponding conditions hold:
 
2
 
3
  ``` cpp
4
  template<class ForwardIterator, class T>
5
  void replace(ForwardIterator first, ForwardIterator last,
6
  const T& old_value, const T& new_value);
7
+ template<class ExecutionPolicy, class ForwardIterator, class T>
8
+ void replace(ExecutionPolicy&& exec,
9
+ ForwardIterator first, ForwardIterator last,
10
+ const T& old_value, const T& new_value);
11
 
12
  template<class ForwardIterator, class Predicate, class T>
13
  void replace_if(ForwardIterator first, ForwardIterator last,
14
  Predicate pred, const T& new_value);
15
+ template<class ExecutionPolicy, class ForwardIterator, class Predicate, class T>
16
+ void replace_if(ExecutionPolicy&& exec,
17
+ ForwardIterator first, ForwardIterator last,
18
+ Predicate pred, const T& new_value);
19
  ```
20
 
21
  *Requires:* The expression `*first = new_value` shall be valid.
22
 
23
  *Effects:* Substitutes elements referred by the iterator `i` in the
 
31
  template<class InputIterator, class OutputIterator, class T>
32
  OutputIterator
33
  replace_copy(InputIterator first, InputIterator last,
34
  OutputIterator result,
35
  const T& old_value, const T& new_value);
36
+ template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2, class T>
37
+ ForwardIterator2
38
+ replace_copy(ExecutionPolicy&& exec,
39
+ ForwardIterator1 first, ForwardIterator1 last,
40
+ ForwardIterator2 result,
41
+ const T& old_value, const T& new_value);
42
 
43
  template<class InputIterator, class OutputIterator, class Predicate, class T>
44
  OutputIterator
45
  replace_copy_if(InputIterator first, InputIterator last,
46
  OutputIterator result,
47
  Predicate pred, const T& new_value);
48
+ template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2,
49
+ class Predicate, class T>
50
+ ForwardIterator2
51
+ replace_copy_if(ExecutionPolicy&& exec,
52
+ ForwardIterator1 first, ForwardIterator1 last,
53
+ ForwardIterator2 result,
54
+ Predicate pred, const T& new_value);
55
  ```
56
 
57
  *Requires:* The results of the expressions `*first` and `new_value`
58
+ shall be writable ([[iterator.requirements.general]]) to the `result`
59
+ output iterator. The ranges \[`first`, `last`) and \[`result`,
60
+ `result + (last - first)`) shall not overlap.
61
 
62
  *Effects:* Assigns to every iterator `i` in the range \[`result`,
63
  `result + (last - first)`) either `new_value` or
64
  `*(first + (i - result))` depending on whether the following
65
  corresponding conditions hold: