Boost logo

Boost :

Subject: Re: [boost] [boost-lists][string algo] C++0x string algo.
From: Germán Diago (germandiago_at_[hidden])
Date: 2010-01-17 11:40:17

> I wouldn't find it ok for split to return a vector<string> since I like to
> be kept in control of how I store my elements, and there is no control
> without taking the container as an argument or using the method I just
> mentioned.

I would like to be able to use it like this:

split(str, predseparators);

Which returns a range. I think this is possible.
You always return a range, and if you want to store it, you
can copy the returned range to a vector<string>, for example.
So it would be quite realistic (I think) to adapt split so that
returns always ranges and
if you want a copy, make a explicit copy in the code:

auto r = split(str, predseparators);

vector<string> vec(r.begin(), r.end());

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