
on Sat Jul 23 2011, Mathias Gaunard <mathias.gaunard-AT-ens-lyon.org> wrote:
On 07/23/2011 05:13 PM, Dave Abrahams wrote:
Well, if we want something like std::vector to be a Range, then we have to accept that at least *some* Ranges do propagate constness. And I'm pretty sure that we don't want other Ranges (std::pair<char*,char*>) to propagate constness. So unless the documentation says otherwise, I would assume that the concept doesn't say anything about whether constness is propagated. If you want to write generic Range code you have to account for both cases.
Constness is propagated for containers, yes, but sub_range is not a container, it is a view of another range, so it should [not] propagate the constness.
Really? Why not? If the Range concept said that views must not propagate constness, that would be one thing... but it doesn't, does it? -- Dave Abrahams BoostPro Computing http://www.boostpro.com