@@ -27,7 +27,7 @@ int main ( int /*argc*/, char * /*argv*/ [] ) {
27
27
// algorithms. They all have the same (dual) interface.
28
28
29
29
// There is a procedural interface, based on std::search:
30
- if ( ba::boyer_moore_search ( haystack.begin (), haystack.end (), needle1.begin (), needle1.end ()) != haystack.end ( ))
30
+ if ( ba::boyer_moore_search ( haystack.begin (), haystack.end (), needle1.begin (), needle1.end ()) != std::make_pair ( haystack.end (), haystack. end () ))
31
31
std::cout << " Found '" << needle1 << " ' in '" << haystack << " ' (boyer-moore 1)" << std::endl;
32
32
else
33
33
std::cout << " Did NOT find '" << needle1 << " ' in '" << haystack << " ' (boyer-moore 1)" << std::endl;
@@ -36,19 +36,19 @@ int main ( int /*argc*/, char * /*argv*/ [] ) {
36
36
// you can create a search object and use that over and over again - amortizing the setup
37
37
// costs across several searches
38
38
ba::boyer_moore<std::string::const_iterator> search1 ( needle1.begin (), needle1.end ());
39
- if ( search1 ( haystack.begin (), haystack.end ()) != haystack.end ( ))
39
+ if ( search1 ( haystack.begin (), haystack.end ()) != std::make_pair ( haystack.end (), haystack. end () ))
40
40
std::cout << " Found '" << needle1 << " ' in '" << haystack << " ' (boyer-moore 2)" << std::endl;
41
41
else
42
42
std::cout << " Did NOT find '" << needle1 << " ' in '" << haystack << " ' (boyer-moore 2)" << std::endl;
43
43
44
44
// There is also an implementation of boyer-moore-horspool searching
45
- if ( ba::boyer_moore_horspool_search ( haystack.begin (), haystack.end (), needle1.begin (), needle1.end ()) != haystack.end ( ))
45
+ if ( ba::boyer_moore_horspool_search ( haystack.begin (), haystack.end (), needle1.begin (), needle1.end ()) != std::make_pair ( haystack.end (), haystack. end () ))
46
46
std::cout << " Found '" << needle1 << " ' in '" << haystack << " ' (boyer-moore-horspool)" << std::endl;
47
47
else
48
48
std::cout << " Did NOT find '" << needle1 << " ' in '" << haystack << " ' (boyer-moore-horspool)" << std::endl;
49
49
50
50
// And also the knuth-pratt-morris search algorithm
51
- if ( ba::knuth_morris_pratt_search ( haystack.begin (), haystack.end (), needle1.begin (), needle1.end ()) != haystack.end ( ))
51
+ if ( ba::knuth_morris_pratt_search ( haystack.begin (), haystack.end (), needle1.begin (), needle1.end ()) != std::make_pair ( haystack.end (), haystack. end () ))
52
52
std::cout << " Found '" << needle1 << " ' in '" << haystack << " ' (knuth_morris_pratt)" << std::endl;
53
53
else
54
54
std::cout << " Did NOT find '" << needle1 << " ' in '" << haystack << " ' (knuth_morris_pratt)" << std::endl;
0 commit comments