|
Boost : |
Subject: Re: [boost] [range] Should ranges really propagate constess to the data ?
From: Samuel Debionne (debionne_at_[hidden])
Date: 2011-07-26 04:55:25
Le 25/07/2011 21:38, Dave Abrahams a écrit :
> If the Range concept said that views must not propagate constness, that
> would be one thing... but it doesn't, does it?
Thank you all for clarifying this. Like Mathias, I have the feeling that
Views should not propagate constness, but as I understand it now, Views
are only a special case (refinement ?) of Ranges. Maybe there is room
for a View concept that will be more specific about constness
propagatation ?
I suggest two improvements in the documentation :
1. In the Range Concept Overview, add a note about constness
propagation. Something along "the concept doesn't say anything about
whether constness is propagated to the data. If you want to write
generic Range code you have to account for both cases."
2. In the subrange, make the sentence "the sub_range class do propagate
constness since it knows what a corresponding const_iterator is" bring
out as an important admonition since it is an unexpected behaviour.
Samuel
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk