From Jason Turner

[alg.adjacent.find]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpzkj2m3er/{from.md → to.md} +10 -1
tmp/tmpzkj2m3er/{from.md → to.md} RENAMED
@@ -1,20 +1,29 @@
1
  ### Adjacent find <a id="alg.adjacent.find">[[alg.adjacent.find]]</a>
2
 
3
  ``` cpp
4
  template<class ForwardIterator>
5
  ForwardIterator adjacent_find(ForwardIterator first, ForwardIterator last);
 
 
 
6
 
7
  template<class ForwardIterator, class BinaryPredicate>
8
  ForwardIterator adjacent_find(ForwardIterator first, ForwardIterator last,
9
  BinaryPredicate pred);
 
 
 
 
10
  ```
11
 
12
  *Returns:* The first iterator `i` such that both `i` and `i + 1` are in
13
  the range \[`first`, `last`) for which the following corresponding
14
  conditions hold: `*i == *(i + 1), pred(*i, *(i + 1)) != false`. Returns
15
  `last` if no such iterator is found.
16
 
17
- *Complexity:* For a nonempty range, exactly
18
  `min((i - first) + 1, (last - first) - 1)` applications of the
19
  corresponding predicate, where `i` is `adjacent_find`’s return value.
 
 
20
 
 
1
  ### Adjacent find <a id="alg.adjacent.find">[[alg.adjacent.find]]</a>
2
 
3
  ``` cpp
4
  template<class ForwardIterator>
5
  ForwardIterator adjacent_find(ForwardIterator first, ForwardIterator last);
6
+ template<class ExecutionPolicy, class ForwardIterator>
7
+ ForwardIterator adjacent_find(ExecutionPolicy&& exec,
8
+ ForwardIterator first, ForwardIterator last);
9
 
10
  template<class ForwardIterator, class BinaryPredicate>
11
  ForwardIterator adjacent_find(ForwardIterator first, ForwardIterator last,
12
  BinaryPredicate pred);
13
+ template<class ExecutionPolicy, class ForwardIterator, class BinaryPredicate>
14
+ ForwardIterator adjacent_find(ExecutionPolicy&& exec,
15
+ ForwardIterator first, ForwardIterator last,
16
+ BinaryPredicate pred);
17
  ```
18
 
19
  *Returns:* The first iterator `i` such that both `i` and `i + 1` are in
20
  the range \[`first`, `last`) for which the following corresponding
21
  conditions hold: `*i == *(i + 1), pred(*i, *(i + 1)) != false`. Returns
22
  `last` if no such iterator is found.
23
 
24
+ *Complexity:* For the overloads with no `ExecutionPolicy`, exactly
25
  `min((i - first) + 1, (last - first) - 1)` applications of the
26
  corresponding predicate, where `i` is `adjacent_find`’s return value.
27
+ For the overloads with an `ExecutionPolicy`, 𝑂(`last - first`)
28
+ applications of the corresponding predicate.
29