Subject: Re: [boost] [move] [range] move algorithm (was: interest: the pass-by-value...)
From: Adam Wulkiewicz (adam.wulkiewicz_at_[hidden])
Date: 2014-02-15 17:17:04
Krzysztof Czainski wrote:
> 2014-02-15 1:05 GMT+01:00 Adam Wulkiewicz <adam.wulkiewicz_at_[hidden]>:
>> Krzysztof Czainski wrote:
>>> 2014-02-14 18:16 GMT+01:00 Lars Viklund <zao_at_[hidden]>:
>>> Note, that an algorithm boost::move also exists:
>>> And I'm not sure how a Range-based complement to the move algorithm could
>>> look like, but it may also turn out useful.
>> Probably like this:
>> boost::move(range, out_it) ;
> Hmm, how about:
> boost::copy( range | movable, out_it );
Yes, of course this should also be possible. There is already
boost::move_iterator in Boost.Move. To be consistent with the standard
we should probably also have boost::move() algorithm and a range
adaptor. But the naming scheme for Range adaptors is different, the past
tense should be used, right? Hence "moved". And operator | could just
generate std::pair<boost::move_iterator<It>, boost::move_iterator<It>>.
But I'm not sure in which library this code should be placed because
this creates an additional dependency.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk