diff --git a/include/boost/half_open_range.hpp b/include/boost/half_open_range.hpp index ac8d057..1de1e9d 100644 --- a/include/boost/half_open_range.hpp +++ b/include/boost/half_open_range.hpp @@ -5,8 +5,10 @@ // for any purpose. // // Revision History: -// 04 Feb 2001 Support for user-defined iterator categories (David Abrahams) -// 30 Jan 2001 Initial Checkin (David Abrahams) +// 11 Feb 2001 Use new iterator_adaptor interface, Fixes for Borland. +// (Dave Abrahams) +// 04 Feb 2001 Support for user-defined iterator categories (Dave Abrahams) +// 30 Jan 2001 Initial Checkin (Dave Abrahams) #ifndef BOOST_HALF_OPEN_RANGE_HPP_ # define BOOST_HALF_OPEN_RANGE_HPP_ @@ -75,7 +77,7 @@ namespace detail { static const Incrementable choose(const Incrementable& start, const Incrementable& finish) { return finish_chooser<( - boost::is_convertible::value + ::boost::is_convertible::value )>::template rebind::choose(start, finish); } }; @@ -85,16 +87,18 @@ namespace detail { template struct half_open_range { - typedef iterator_adaptor, - counting_iterator_traits > iterator; + typedef typename counting_iterator_generator::type iterator; private: // utility type definitions + // Using iter_t prevents compiler confusion with boost::iterator + typedef typename counting_iterator_generator::type iter_t; + typedef std::less less_value; - typedef typename boost::detail::iterator_traits::iterator_category category; + typedef typename iter_t::iterator_category category; + typedef half_open_range self; public: - typedef iterator const_iterator; + typedef iter_t const_iterator; typedef typename counting_iterator_traits::value_type value_type; typedef typename counting_iterator_traits::difference_type difference_type; typedef typename counting_iterator_traits::reference reference; @@ -130,7 +134,14 @@ struct half_open_range #endif ) {} - + + half_open_range& operator=(const self& x) + { + m_start = x.m_start; + m_finish = x.m_finish; + return *this; + } + half_open_range& operator=(const std::pair& x) { m_start = x.first;