Boost logo

Boost :

Subject: Re: [boost] [range] Should ranges really propagate constess to the data ?
From: Mathias Gaunard (mathias.gaunard_at_[hidden])
Date: 2011-07-23 09:16:09


On 07/23/2011 02:21 PM, Olaf van der Spek wrote:
> On Fri, Jul 22, 2011 at 6:16 PM, Mathias Gaunard
> <mathias.gaunard_at_[hidden]> wrote:
>> That explains the strange problems I had when I tried using sub_range.
>> iterator_range does not have those problems.
>>
>> But it seems to be a feature, it you look at the doc of sub_range it says,
>> when comparing sub_range to iterator_range,
>> "Moreover, the sub_range class can propagate constness since it knows what a
>> corresponding const_iterator is."
>>
>> This is, in my opinion, a mistake.
>> const sub_range<T> should *not* behave like sub_range<const T>.
>
> Why (not)?
> What's the problem with it?

Whether the sub_range object is a temporary or not should not affect
whether the wrapped object is writable or not.


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