Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2005-06-15 21:13:08


I note:

    //////////////////////////////////////////////////////////////////////////
    // default
    //////////////////////////////////////////////////////////////////////////
    
    template< typename C >
    struct range_iterator
    {
        typedef BOOST_DEDUCED_TYPENAME C::iterator type;
    };

(***)
    
    //////////////////////////////////////////////////////////////////////////
    // pair
    //////////////////////////////////////////////////////////////////////////

    template< typename Iterator >
    struct range_iterator< std::pair<Iterator,Iterator> >
    {
        typedef Iterator type;
    };
    
    template< typename Iterator >
    struct range_iterator< const std::pair<Iterator,Iterator> >
    {
        typedef Iterator type;
    };

    //////////////////////////////////////////////////////////////////////////
    // array
    //////////////////////////////////////////////////////////////////////////

    template< typename T, std::size_t sz >
    struct range_iterator< T[sz] >
    {
        typedef T* type;
    };

    template< typename T, std::size_t sz >
    struct range_iterator< const T[sz] >
    {
        typedef const T* type;
    };

It seems like for consistency, there should be:

    template< typename C >
    struct range_iterator<C const>
    {
        typedef BOOST_DEDUCED_TYPENAME C::const_iterator type;
    };

at (***). What am I missing?

-- 
Dave Abrahams
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