
22 Mar
2012
22 Mar
'12
5:27 p.m.
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. -- Dave Abrahams BoostPro Computing http://www.boostpro.com