Boost logo

Boost :

Subject: Re: [boost] [range] adaptors vs. rvalue to lvalue& binding
From: Bronek Kozicki (brok_at_[hidden])
Date: 2012-03-23 05:47:26


On 23/03/2012 02:44, Nathan Ridge wrote:
>
>> Back to your function - perhaps taking unqualified template parameter
>> is not the best idea, and if you want to take a range you might want to
>> be bit more explicit about it? E.g. like this:
> >
>> template<typename T1, typename T2>
>> void modifies_range(boost::joined_range<T1, T2> && rng);
> >
>> I hope users of such "modifies_range" function would find nothing to
>> complain about such an interface.
>
> Unfortunately, the reference collapsing no longer works in this case,
> so this function will not accept an lvalue joined_range.

Of course you are correct. Back to:

   template <typename Range>
   void modifies_range(Range && rng);

B.


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