Ticket #10440: bmtest.cc

File bmtest.cc, 583 bytes (added by boost@…, 8 years ago)

Small test case that fails to compile on Linux w/ g++-4.7.2

Line 
1#include <iostream>
2#include <boost/algorithm/searching/boyer_moore.hpp>
3
4int
5main( int, char ** )
6{
7 const char *needle = "find";
8 const char *haystack = "this is a string that we search if we want to find the needle.";
9
10 const char *hit = boost::algorithm::boyer_moore_search<const char *,const char *> (
11 haystack, haystack + strlen( haystack ),
12 needle, needle + strlen( needle ) );
13
14 if (hit) {
15 std::cout << "Found it!" << std::endl;
16 } else {
17 std::cout << "No match" << std::endl;
18 }
19
20 return 0;
21}