From Jason Turner

[func.search.bmh]

Diff to HTML by rtfpessoa

tmp/tmpv6p9bkj4/{from.md → to.md} RENAMED
@@ -1,8 +1,9 @@
1
  #### Class template `boyer_moore_horspool_searcher` <a id="func.search.bmh">[[func.search.bmh]]</a>
2
 
3
  ``` cpp
 
4
  template<class RandomAccessIterator1,
5
  class Hash = hash<typename iterator_traits<RandomAccessIterator1>::value_type>,
6
  class BinaryPredicate = equal_to<>>
7
  class boyer_moore_horspool_searcher {
8
  public:
@@ -19,10 +20,11 @@ template<class RandomAccessIterator1,
19
  RandomAccessIterator1 pat_first_; // exposition only
20
  RandomAccessIterator1 pat_last_; // exposition only
21
  Hash hash_; // exposition only
22
  BinaryPredicate pred_; // exposition only
23
  };
 
24
  ```
25
 
26
  ``` cpp
27
  boyer_moore_horspool_searcher(RandomAccessIterator1 pat_first,
28
  RandomAccessIterator1 pat_last,
@@ -32,22 +34,21 @@ boyer_moore_horspool_searcher(RandomAccessIterator1 pat_first,
32
 
33
  *Preconditions:* The value type of `RandomAccessIterator1` meets the
34
  *Cpp17DefaultConstructible*, *Cpp17CopyConstructible*, and
35
  *Cpp17CopyAssignable* requirements.
36
 
37
- *Preconditions:* Let `V` be
38
- `iterator_traits<RandomAccessIterator1>::value_type`. For any two values
39
- `A` and `B` of type `V`, if `pred(A, B) == true`, then `hf(A) == hf(B)`
40
- is `true`.
41
 
42
  *Effects:* Initializes `pat_first_` with `pat_first`, `pat_last_` with
43
- `pat_last`, `hash_` with `hf`, and `pred_` with `pred`.
44
 
45
  *Throws:* Any exception thrown by the copy constructor of
46
  `RandomAccessIterator1`, or by the default constructor, copy
47
  constructor, or the copy assignment operator of the value type of
48
- `RandomAccessIterator1` or the copy constructor or `operator()` of
49
  `BinaryPredicate` or `Hash`. May throw `bad_alloc` if additional memory
50
  needed for internal data structures cannot be allocated.
51
 
52
  ``` cpp
53
  template<class RandomAccessIterator2>
@@ -60,11 +61,11 @@ same value type.
60
 
61
  *Effects:* Finds a subsequence of equal values in a sequence.
62
 
63
  *Returns:* A pair of iterators `i` and `j` such that
64
 
65
- - `i` is the first iterator `i` in the range \[`first`,
66
  `last - (pat_last_ - pat_first_)`) such that for every non-negative
67
  integer `n` less than `pat_last_ - pat_first_` the following condition
68
  holds: `pred(*(i + n), *(pat_first_ + n)) != false`, and
69
  - `j == next(i, distance(pat_first_, pat_last_))`.
70
 
 
1
  #### Class template `boyer_moore_horspool_searcher` <a id="func.search.bmh">[[func.search.bmh]]</a>
2
 
3
  ``` cpp
4
+ namespace std {
5
  template<class RandomAccessIterator1,
6
  class Hash = hash<typename iterator_traits<RandomAccessIterator1>::value_type>,
7
  class BinaryPredicate = equal_to<>>
8
  class boyer_moore_horspool_searcher {
9
  public:
 
20
  RandomAccessIterator1 pat_first_; // exposition only
21
  RandomAccessIterator1 pat_last_; // exposition only
22
  Hash hash_; // exposition only
23
  BinaryPredicate pred_; // exposition only
24
  };
25
+ }
26
  ```
27
 
28
  ``` cpp
29
  boyer_moore_horspool_searcher(RandomAccessIterator1 pat_first,
30
  RandomAccessIterator1 pat_last,
 
34
 
35
  *Preconditions:* The value type of `RandomAccessIterator1` meets the
36
  *Cpp17DefaultConstructible*, *Cpp17CopyConstructible*, and
37
  *Cpp17CopyAssignable* requirements.
38
 
39
+ Let `V` be `iterator_traits<RandomAccessIterator1>::value_type`. For any
40
+ two values `A` and `B` of type `V`, if `pred(A, B) == true`, then
41
+ `hf(A) == hf(B)` is `true`.
 
42
 
43
  *Effects:* Initializes `pat_first_` with `pat_first`, `pat_last_` with
44
+ `pat_last`, `hash_` with `hf`, and \texttt{pred\_} with `pred`.
45
 
46
  *Throws:* Any exception thrown by the copy constructor of
47
  `RandomAccessIterator1`, or by the default constructor, copy
48
  constructor, or the copy assignment operator of the value type of
49
+ `RandomAccessIterator1`, or the copy constructor or `operator()` of
50
  `BinaryPredicate` or `Hash`. May throw `bad_alloc` if additional memory
51
  needed for internal data structures cannot be allocated.
52
 
53
  ``` cpp
54
  template<class RandomAccessIterator2>
 
61
 
62
  *Effects:* Finds a subsequence of equal values in a sequence.
63
 
64
  *Returns:* A pair of iterators `i` and `j` such that
65
 
66
+ - `i` is the first iterator in the range \[`first`,
67
  `last - (pat_last_ - pat_first_)`) such that for every non-negative
68
  integer `n` less than `pat_last_ - pat_first_` the following condition
69
  holds: `pred(*(i + n), *(pat_first_ + n)) != false`, and
70
  - `j == next(i, distance(pat_first_, pat_last_))`.
71