@@ -27,7 +27,7 @@ int main ( int /*argc*/, char * /*argv*/ [] ) {
2727// algorithms. They all have the same (dual) interface.
2828
2929// 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 () ))
3131 std::cout << " Found '" << needle1 << " ' in '" << haystack << " ' (boyer-moore 1)" << std::endl;
3232 else
3333 std::cout << " Did NOT find '" << needle1 << " ' in '" << haystack << " ' (boyer-moore 1)" << std::endl;
@@ -36,19 +36,19 @@ int main ( int /*argc*/, char * /*argv*/ [] ) {
3636// you can create a search object and use that over and over again - amortizing the setup
3737// costs across several searches
3838 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 () ))
4040 std::cout << " Found '" << needle1 << " ' in '" << haystack << " ' (boyer-moore 2)" << std::endl;
4141 else
4242 std::cout << " Did NOT find '" << needle1 << " ' in '" << haystack << " ' (boyer-moore 2)" << std::endl;
4343
4444// 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 () ))
4646 std::cout << " Found '" << needle1 << " ' in '" << haystack << " ' (boyer-moore-horspool)" << std::endl;
4747 else
4848 std::cout << " Did NOT find '" << needle1 << " ' in '" << haystack << " ' (boyer-moore-horspool)" << std::endl;
4949
5050// 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 () ))
5252 std::cout << " Found '" << needle1 << " ' in '" << haystack << " ' (knuth_morris_pratt)" << std::endl;
5353 else
5454 std::cout << " Did NOT find '" << needle1 << " ' in '" << haystack << " ' (knuth_morris_pratt)" << std::endl;
0 commit comments