Hi, Meryl Silverburgh wrote: <snip>
The problem is with template instantiation. Since you are passing "string" and not "const string" as an argument to make_split_iterator, the resulting type is actualy split_iteratorstring::iterator. This is not the same (nor convertible) to split_iteratorstring::const_iterator.
So the simple fix would be to change the definition of the string_split to split_iteratorstring::iterator.
In addition, you will need to implement integer_compare.
In addition, you will need to implement integer_compare. I have not included it in may mail.
Thanks. I notice that. Can you please help me understand how to implement integer_compare (a predicate comparision object)?
What are the input type? bool operator() (const ? &a, const ? &b) ?
and if the input strings are '/1/1/5' and '1/1/10' what will be passed to the integer_compare?
It is an element comparison predicate therefore its arguments should be
able to accept elements from the input sequence. So you have guessed the
signature right. The question marks can be substituted by
string_split::value_type. And that is an iterator_range pointing to a
match found in the input string (iterator_rangestring::iterator)
For string '/1/1/5', following ranges will be returned