Subject: Re: [boost] [range] adaptors vs. rvalue to lvalue& binding
From: Dave Abrahams (dave_at_[hidden])
Date: 2012-03-22 13:27:08
on Thu Mar 22 2012, Arno SchÃ¶dl <aschoedl-AT-think-cell.com> wrote:
> 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.
- 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
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk