Boost logo

Boost :

Subject: Re: [boost] Assign V2 - first impression
From: John Bytheway (jbytheway+boost_at_[hidden])
Date: 2011-06-23 04:14:50


On 22/06/11 21:31, er wrote:
<snip>
>>> Conversion from ranges to containers
>>>
>> This sentence doesn't make sence to me. std::container(range.begin(),
>> range.end()) is supported by all containers.
>
> Please see Conversion in the tutorial. The first sentence gives it away:
>
> This section deals with conversion from a Range to collections of
> elements that need not (but may) support iterators.

As I see it, the primary advantage of this conversion feature is that
you can use it when th range only exists as a temporary. e.g. if a
function returns a range, you can use it without first assigning that
range to a variable. Perhaps this aspect could be made more clear?

John Bytheway


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk