Meryl Silverburgh wrote:
#include <iostream> #include <string>
#include "boost/algorithm/string/find_iterator.hpp" #include "boost/algorithm/string/classification.hpp" #include "boost/algorithm/string/predicate.hpp"
using namespace std; using namespace boost;
typedef split_iteratorstring::iterator string_split;
class integer_compare { public: bool operator() (const string_split::value_type &a, const string_split::value_type &b) { return true; } };
int main(int argc, char **argv) { cout << "hello world" << endl;
string s1("/1/11/2"); string s2("/1/1/3");
iterator_range
r1( make_split_iterator(s1, token_finder(is_any_of("/")), string_split()); iterator_range
r2( make_split_iterator(s2, token_finder(is_any_of("/")), string_split()); if(lexicographical_compare(r1.begin(), r1.end(),
r2.begin(), r2.end(), integer_compare())) { cout << " s1 is less " << endl; } else { cout << " s2 is less " << endl; }
}
i have added '#include "boost/algorithm/string/finder.hpp"' but it still does not solve my error.
A missing parenthesis is missing there. Instead of
iterator_range