Re: [boost] [range] Should ranges really propagate constess to the data ?

Date: Mon, 25 Jul 2011 10:01:09 +0200 From: Thorsten Ottosen <thorsten.ottosen@dezide.com> To: boost@lists.boost.org Subject: Re: [boost] [range] Should ranges really propagate constess to the data ? Message-ID: <4E2D22C5.7050701@dezide.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Thorsten Ottosen:
Den 24-07-2011 16:04, Mathias Gaunard skrev:
I thought that was the point of sub_range: to be the same as iterator_range, except the template parameter it takes is a range rather than an iterator, simplifying things when only ranges and not iterators are involved.
+ propagation of constness.
Consider using sub_range<T> as the type of a member variable.
It would be very annoying in some cases that we cannot return a view that is const-correct and which requires us to construct a temporary view instead of just returning a reference to the existing view.
The divergent opinions on sub_range in this thread convinced me to add marshalling support for iterator_range to the code generator I'm working on and I've now done so. Previously I had only added support for sub_range. Regards, Brian Wood Ebenezer Enterprises http://webEbenezer.net
participants (1)
-
Brian Wood