More Boost.Range questions

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

"David Abrahams" <dave@boost-consulting.com> wrote in message news:uzmtrjbgr.fsf@boost-consulting.com... | | I note: | | ////////////////////////////////////////////////////////////////////////// | // default | ////////////////////////////////////////////////////////////////////////// | | template< typename C > | struct range_iterator | { | typedef BOOST_DEDUCED_TYPENAME C::iterator type; | }; | | (***) [snip, no const for C ] | at (***). What am I missing? Not much. It must be a left-over from desperate attempts to make the code portable. In general, people seem to prefer range_result_iterator<T>::type. We shuold just make range_iterator<const T> as well as range_iterator<T> valid and then depricate range_const_iterator and range_result_iterator. -Thorsten
participants (2)
-
David Abrahams
-
Thorsten Ottosen