
on Thu Mar 22 2012, Dave Abrahams <dave-AT-boostpro.com> wrote:
on Thu Mar 22 2012, Arno Schödl <aschoedl-AT-think-cell.com> 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? Or...? -- Dave Abrahams BoostPro Computing http://www.boostpro.com