Boost logo

Boost :

Subject: Re: [boost] [range] Should ranges really propagate constess to the data ?
From: Brian Wood (woodbrian77_at_[hidden])
Date: 2011-07-25 18:39:39


Date: Mon, 25 Jul 2011 10:01:09 +0200
From: Thorsten Ottosen <thorsten.ottosen_at_[hidden]>
To: boost_at_[hidden]
Subject: Re: [boost] [range] Should ranges really propagate constess
       to the data ?
Message-ID: <4E2D22C5.7050701_at_[hidden]>
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


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