Boost logo

Boost Users :

From: Meryl Silverburgh (silverburgh.meryl_at_[hidden])
Date: 2007-02-20 14:12:40


On 2/20/07, Pavol Droba <droba_at_[hidden]> wrote:
> Hi,
>
> There is realy no magic there. You just need to realize, that you
> are not getting a string, rather a range. Range is a generalization of a
> pair of iterators.
>
> In case of split_iterator, these iterators point to first and one past
> the last character of the current token.
>
> Example can be found in
> /boost/libs/algorithm/string/example/split_example.cpp
>
> Regards,
> Pavol.

Thanks for your help. I have another question, how can I can i
terminate the for loop when loop using string_split?

class integer_compare {
public:
       bool operator() (const string_split::value_type &a, const
string_split::value_type &b) {
                // how can I iterate thru the string? how can i terminate
the for loop?

                for (const string_split sitr = a; sitr != ???; sitr++) {
                        
                        // print out each substring (after '/' is stripped out)
                        cout << copy_range<std::string>(*sitr) << endl;
                        
                }
               return true;
       }
};

>
> Meryl Silverburgh wrote:
> > hi,
> >
> > Can someone please tell me where I can find example of
> > split_iterator<string::iterator>
> >
> > If I have 2 split_iterator<string::iterator>s, how can I compare the 2
> > strings that the split_iterator pointing to?
> >
> > Thank you.
> > _______________________________________________
> > Boost-users mailing list
> > Boost-users_at_[hidden]
> > http://lists.boost.org/mailman/listinfo.cgi/boost-users
> >
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net