Boost logo

Boost :

From: Aleksey Gurtovoy (alexy_at_[hidden])
Date: 2001-08-16 20:10:49

Ross Smith wrote:
> I think you've misunderstood the way the output iterator version was
> intended to work. I was the one who originally posted the idea, and my
> suggested signature and usage look like this:
> template <typename OutputIterator>
> OutputIterator split(const std::string& source,
> OutputIterator target,
> const std::string& delimiters = "
> \f\n\r\t");
> std::string sentence("foo bar zap");
> std::vector<std::string> words;
> split(sentence, std::back_inserter(words));

With "sequence arguments support" you can do even better:

    split(std::string const& source, std::string const& delimiters =
    std::string sentence("foo bar zap");
    boost::vector<std::string> words(boost::split(sentence));


Boost list run by bdawes at, gregod at, cpdaniel at, john at