Boost logo

Boost :

From: Eric Niebler (eric_at_[hidden])
Date: 2006-05-08 12:15:10


David Abrahams wrote:
> Hi Thorsten,
>
> I took the liberty of checking this patch into the HEAD:
>
>
>
> ------------------------------------------------------------------------
>
> Index: iterator.hpp
> ===================================================================
> RCS file: /cvsroot/boost/boost/boost/range/iterator.hpp,v
> retrieving revision 1.4
> retrieving revision 1.5
> diff -b -d -u -b -u -r1.4 -r1.5
> --- iterator.hpp 5 Jan 2005 18:19:31 -0000 1.4
> +++ iterator.hpp 8 May 2006 10:21:50 -0000 1.5
> @@ -37,6 +37,12 @@
> typedef BOOST_DEDUCED_TYPENAME C::iterator type;
> };
>
> + template< typename C >
> + struct range_iterator<C const>
> + {
> + typedef BOOST_DEDUCED_TYPENAME C::const_iterator type;
> + };
> +
> //////////////////////////////////////////////////////////////////////////
> // pair
> //////////////////////////////////////////////////////////////////////////
>
>
> ------------------------------------------------------------------------
>
>
> Please let me know if you have any objections.

I object. In the current range interface, the meaning of the range
metafunctions are as follows:

range_iterator: always return ::iterator
range_const_iterator: always return ::const_iterator
range_result_iterator: return either ::iterator or ::const_iterator
depending on the const-ness of the argument.

This was deemed an unfortunate design, and there is a reworking of the
Range interface in the pipeline. Thorsten wanted to apply it for 1.34,
but it was too late in the process.

Your patch gets everything all mixed up. My suggestion is that you back
this change out and Thorsten applies his changes to HEAD.

-- 
Eric Niebler
Boost Consulting
www.boost-consulting.com

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