From Jason Turner

[alg.search]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmp_8kr3kph/{from.md → to.md} +36 -0
tmp/tmp_8kr3kph/{from.md → to.md} RENAMED
@@ -3,17 +3,29 @@
3
  ``` cpp
4
  template<class ForwardIterator1, class ForwardIterator2>
5
  ForwardIterator1
6
  search(ForwardIterator1 first1, ForwardIterator1 last1,
7
  ForwardIterator2 first2, ForwardIterator2 last2);
 
 
 
 
 
8
 
9
  template<class ForwardIterator1, class ForwardIterator2,
10
  class BinaryPredicate>
11
  ForwardIterator1
12
  search(ForwardIterator1 first1, ForwardIterator1 last1,
13
  ForwardIterator2 first2, ForwardIterator2 last2,
14
  BinaryPredicate pred);
 
 
 
 
 
 
 
15
  ```
16
 
17
  *Effects:* Finds a subsequence of equal values in a sequence.
18
 
19
  *Returns:* The first iterator `i` in the range \[`first1`,
@@ -35,10 +47,23 @@ template<class ForwardIterator, class Size, class T>
35
  template<class ForwardIterator, class Size, class T,
36
  class BinaryPredicate>
37
  ForwardIterator
38
  search_n(ForwardIterator first, ForwardIterator last, Size count,
39
  const T& value, BinaryPredicate pred);
 
 
 
 
 
 
 
 
 
 
 
 
 
40
  ```
41
 
42
  *Requires:* The type `Size` shall be convertible to integral
43
  type ([[conv.integral]], [[class.conv]]).
44
 
@@ -51,5 +76,16 @@ following corresponding conditions hold:
51
  such iterator is found.
52
 
53
  *Complexity:* At most `last - first` applications of the corresponding
54
  predicate.
55
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  ``` cpp
4
  template<class ForwardIterator1, class ForwardIterator2>
5
  ForwardIterator1
6
  search(ForwardIterator1 first1, ForwardIterator1 last1,
7
  ForwardIterator2 first2, ForwardIterator2 last2);
8
+ template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2>
9
+ ForwardIterator1
10
+ search(ExecutionPolicy&& exec,
11
+ ForwardIterator1 first1, ForwardIterator1 last1,
12
+ ForwardIterator2 first2, ForwardIterator2 last2);
13
 
14
  template<class ForwardIterator1, class ForwardIterator2,
15
  class BinaryPredicate>
16
  ForwardIterator1
17
  search(ForwardIterator1 first1, ForwardIterator1 last1,
18
  ForwardIterator2 first2, ForwardIterator2 last2,
19
  BinaryPredicate pred);
20
+ template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2,
21
+ class BinaryPredicate>
22
+ ForwardIterator1
23
+ search(ExecutionPolicy&& exec,
24
+ ForwardIterator1 first1, ForwardIterator1 last1,
25
+ ForwardIterator2 first2, ForwardIterator2 last2,
26
+ BinaryPredicate pred);
27
  ```
28
 
29
  *Effects:* Finds a subsequence of equal values in a sequence.
30
 
31
  *Returns:* The first iterator `i` in the range \[`first1`,
 
47
  template<class ForwardIterator, class Size, class T,
48
  class BinaryPredicate>
49
  ForwardIterator
50
  search_n(ForwardIterator first, ForwardIterator last, Size count,
51
  const T& value, BinaryPredicate pred);
52
+
53
+ template<class ExecutionPolicy, class ForwardIterator, class Size, class T>
54
+ ForwardIterator
55
+ search_n(ExecutionPolicy&& exec,
56
+ ForwardIterator first, ForwardIterator last,
57
+ Size count, const T& value);
58
+ template<class ExecutionPolicy, class ForwardIterator, class Size, class T,
59
+ class BinaryPredicate>
60
+ ForwardIterator
61
+ search_n(ExecutionPolicy&& exec,
62
+ ForwardIterator first, ForwardIterator last,
63
+ Size count, const T& value,
64
+ BinaryPredicate pred);
65
  ```
66
 
67
  *Requires:* The type `Size` shall be convertible to integral
68
  type ([[conv.integral]], [[class.conv]]).
69
 
 
76
  such iterator is found.
77
 
78
  *Complexity:* At most `last - first` applications of the corresponding
79
  predicate.
80
 
81
+ ``` cpp
82
+ template<class ForwardIterator, class Searcher>
83
+ ForwardIterator search(ForwardIterator first, ForwardIterator last,
84
+ const Searcher& searcher);
85
+ ```
86
+
87
+ *Effects:* Equivalent to: `return searcher(first, last).first;`
88
+
89
+ *Remarks:* `Searcher` need not meet the `CopyConstructible`
90
+ requirements.
91
+