]> git.lyx.org Git - lyx.git/blobdiff - boost/boost/iterator_adaptors.hpp
complie fix
[lyx.git] / boost / boost / iterator_adaptors.hpp
index f0ef01068ba39c94bc90bf8f50dcf57da9726710..18e7c9c3e2895b5c81a0cb17d8fcc64cd0602d65 100644 (file)
 # include <boost/type.hpp>
 # include <boost/static_assert.hpp>
 # include <boost/type_traits.hpp>
+# include <boost/type_traits/conversion_traits.hpp>
 # include <boost/detail/iterator.hpp>
 # include <boost/detail/select_type.hpp>
 
@@ -382,7 +383,7 @@ namespace detail {
   };
 
 
-# ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+# if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) || defined(BOOST_NO_STD_ITERATOR_TRAITS)
 
    // Select default pointer and reference types for adapted non-pointer
    // iterators based on the iterator and the value_type. Poor man's partial
@@ -761,6 +762,12 @@ namespace detail {
 
       BOOST_STATIC_ASSERT(forward_iter_with_real_reference);
   };
+
+  template <class T, class Result> struct dependent
+  {
+    typedef Result type;
+  };
+
 } // namespace detail
 
 
@@ -880,7 +887,8 @@ struct iterator_adaptor :
 # pragma warning(pop)
 #endif
 
-    value_type operator[](difference_type n) const
+    template <class diff_type>
+    typename detail::dependent<diff_type, value_type>::type operator[](diff_type n) const
         { return *(*this + n); }
 
     self& operator++() {
@@ -1150,7 +1158,7 @@ template <class OuterIterator,      // Mutable or Immutable, does not matter
 #else
                 = Value &
 #endif
-          , class ConstReference = const Value&
+          , class ConstReference = Value const&
           , class Category = BOOST_ARG_DEPENDENT_TYPENAME boost::detail::iterator_traits<
                 OuterIterator>::iterator_category
           , class Pointer
@@ -1160,7 +1168,7 @@ template <class OuterIterator,      // Mutable or Immutable, does not matter
 #else
                 = Value*
 #endif
-          , class ConstPointer = const Value*
+          , class ConstPointer = Value const*
            >
 struct indirect_iterator_pair_generator
 {