tmp/tmpezbsx1o5/{from.md → to.md}
RENAMED
|
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#### Class template `default_searcher` <a id="func.search.default">[[func.search.default]]</a>
|
| 2 |
+
|
| 3 |
+
``` cpp
|
| 4 |
+
template <class ForwardIterator1, class BinaryPredicate = equal_to<>>
|
| 5 |
+
class default_searcher {
|
| 6 |
+
public:
|
| 7 |
+
default_searcher(ForwardIterator1 pat_first, ForwardIterator1 pat_last,
|
| 8 |
+
BinaryPredicate pred = BinaryPredicate());
|
| 9 |
+
|
| 10 |
+
template <class ForwardIterator2>
|
| 11 |
+
pair<ForwardIterator2, ForwardIterator2>
|
| 12 |
+
operator()(ForwardIterator2 first, ForwardIterator2 last) const;
|
| 13 |
+
|
| 14 |
+
private:
|
| 15 |
+
ForwardIterator1 pat_first_; // exposition only
|
| 16 |
+
ForwardIterator1 pat_last_; // exposition only
|
| 17 |
+
BinaryPredicate pred_; // exposition only
|
| 18 |
+
};
|
| 19 |
+
```
|
| 20 |
+
|
| 21 |
+
``` cpp
|
| 22 |
+
default_searcher(ForwardIterator pat_first, ForwardIterator pat_last,
|
| 23 |
+
BinaryPredicate pred = BinaryPredicate());
|
| 24 |
+
```
|
| 25 |
+
|
| 26 |
+
*Effects:* Constructs a `default_searcher` object, initializing
|
| 27 |
+
`pat_first_` with `pat_first`, \texttt{pat_last\_} with `pat_last`, and
|
| 28 |
+
`pred_` with `pred`.
|
| 29 |
+
|
| 30 |
+
*Throws:* Any exception thrown by the copy constructor of
|
| 31 |
+
`BinaryPredicate` or `ForwardIterator1`.
|
| 32 |
+
|
| 33 |
+
``` cpp
|
| 34 |
+
template<class ForwardIterator2>
|
| 35 |
+
pair<ForwardIterator2, ForwardIterator2>
|
| 36 |
+
operator()(ForwardIterator2 first, ForwardIterator2 last) const;
|
| 37 |
+
```
|
| 38 |
+
|
| 39 |
+
*Effects:* Returns a pair of iterators `i` and `j` such that
|
| 40 |
+
|
| 41 |
+
- `i == search(first, last, pat_first_, pat_last_, pred_)`, and
|
| 42 |
+
- if `i == last`, then `j == last`, otherwise
|
| 43 |
+
`j == next(i, distance(pat_first_, pat_last_))`.
|
| 44 |
+
|