Boost logo

Boost :

Subject: Re: [boost] [range] adaptors vs. rvalue to lvalue& binding
From: Dave Abrahams (dave_at_[hidden])
Date: 2012-03-23 11:20:16

on Thu Mar 22 2012, Dave Abrahams <> wrote:

> on Thu Mar 22 2012, Arno Schödl <> wrote:
>> Hello,
>> ideally I would like to use range-adapted lvalue ranges like any
>> other lvalue ranges. Writing it down naively, as below, does not
>> compile because LoadRefRange takes (and should take?) the range it
>> modifies by lvalue&, while adaptor expressions are rvalues.
> One possibility:
> - make adaptor expressions return const rvalues. The const rvalues will
> bind to T& arguments (where T is a template parameter) by deducing T
> to be const.
> - make even the const_iterators for such adaptors mutable (writable) iterators
> This accurately reflects the fact that such adaptors don't own their values.

Bump. Did nobody understand this suggestion? Bad idea for some reason?

Dave Abrahams
BoostPro Computing

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