cvs -z9 -Q diff -c boost/iterator_adaptors.hpp Index: boost/iterator_adaptors.hpp =================================================================== RCS file: /cvsroot/boost/boost/boost/iterator_adaptors.hpp,v retrieving revision 1.65 diff -c -r1.65 iterator_adaptors.hpp *** boost/iterator_adaptors.hpp 8 Aug 2002 16:42:18 -0000 1.65 --- boost/iterator_adaptors.hpp 5 Sep 2002 19:24:36 -0000 *************** *** 557,562 **** --- 557,565 ---- typedef detail::cons_type type; }; + template + struct iterator_adaptor; + namespace detail { struct end_of_list { }; *************** *** 761,769 **** BOOST_STATIC_ASSERT(forward_iter_with_real_reference); }; - } // namespace detail // This macro definition is only temporary in this file # if !defined(BOOST_MSVC) || BOOST_MSVC > 1300 --- 764,866 ---- BOOST_STATIC_ASSERT(forward_iter_with_real_reference); }; + struct non_random_access_index_iterator_base + { + template + struct index_base_type + : detail::iterator_adaptor_traits_gen::type + { + protected: + typedef iterator_adaptor self; + public: + typedef detail::iterator_adaptor_traits_gen TraitsGen; + typedef typename TraitsGen::type Traits; + + typedef typename Traits::difference_type difference_type; + typedef typename Traits::value_type value_type; + typedef typename Traits::pointer pointer; + typedef typename Traits::reference reference; + typedef typename Traits::iterator_category iterator_category; + + typedef Base base_type; + typedef Policies policies_type; + }; + }; + + struct random_access_index_iterator_base + { + template + struct index_base_type + : detail::iterator_adaptor_traits_gen::type + { + protected: + typedef iterator_adaptor self; + public: + typedef detail::iterator_adaptor_traits_gen TraitsGen; + typedef typename TraitsGen::type Traits; + + typedef typename Traits::difference_type difference_type; + typedef typename Traits::value_type value_type; + typedef typename Traits::pointer pointer; + typedef typename Traits::reference reference; + typedef typename Traits::iterator_category iterator_category; + + typedef Base base_type; + typedef Policies policies_type; + + value_type operator[](difference_type n) const + { return *(*static_cast*>(this) + n); } + }; + }; + + template struct index_category_chooser + { + struct iterator_base + { + template + struct index_base_type; + }; + }; + + template<> struct index_category_chooser + { + typedef non_random_access_index_iterator_base iterator_base; + }; + template<> struct index_category_chooser + { + typedef non_random_access_index_iterator_base iterator_base; + }; + + template<> struct index_category_chooser + { + typedef non_random_access_index_iterator_base iterator_base; + }; + + template<> struct index_category_chooser + { + typedef non_random_access_index_iterator_base iterator_base; + }; + + template<> struct index_category_chooser + { + typedef random_access_index_iterator_base iterator_base; + // typedef non_random_access_index_iterator_base iterator_base; + }; + + template + struct index_iterator_impl + { + typedef detail::iterator_adaptor_traits_gen TraitsGen; + typedef typename TraitsGen::type Traits; + + typedef typename Traits::iterator_category iterator_category; + typedef index_category_chooser::iterator_base iterator_base_generator; + typedef iterator_base_generator::index_base_type type; + }; + + } // namespace detail // This macro definition is only temporary in this file # if !defined(BOOST_MSVC) || BOOST_MSVC > 1300 *************** *** 811,835 **** #ifdef BOOST_RELOPS_AMBIGUITY_BUG iterator_comparisons< iterator_adaptor, ! typename detail::iterator_adaptor_traits_gen::type > #else ! detail::iterator_adaptor_traits_gen::type #endif { ! typedef iterator_adaptor self; public: ! typedef detail::iterator_adaptor_traits_gen TraitsGen; ! typedef typename TraitsGen::type Traits; ! typedef typename Traits::difference_type difference_type; ! typedef typename Traits::value_type value_type; ! typedef typename Traits::pointer pointer; ! typedef typename Traits::reference reference; ! typedef typename Traits::iterator_category iterator_category; ! typedef Base base_type; ! typedef Policies policies_type; private: typedef detail::validator< --- 908,934 ---- #ifdef BOOST_RELOPS_AMBIGUITY_BUG iterator_comparisons< iterator_adaptor, ! typename detail::index_iterator_impl::type > #else ! detail::index_iterator_impl::type #endif { ! typedef detail::index_iterator_impl::type ! index_base_type; ! typedef typename index_base_type::self self; public: ! typedef index_base_type::TraitsGen TraitsGen; ! typedef index_base_type::Traits Traits; ! typedef typename index_base_type::difference_type difference_type; ! typedef typename index_base_type::value_type value_type; ! typedef typename index_base_type::pointer pointer; ! typedef typename index_base_type::reference reference; ! typedef typename index_base_type::iterator_category iterator_category; ! typedef index_base_type::base_type base_type; ! typedef index_base_type::policies_type policies_type; private: typedef detail::validator< *************** *** 879,887 **** #ifdef BOOST_MSVC # pragma warning(pop) #endif - - value_type operator[](difference_type n) const - { return *(*this + n); } self& operator++() { #if !defined(__MWERKS__) || __MWERKS__ >= 0x2405 --- 978,983 ---- *****CVS exited normally with code 1*****