From c93c9211098010917304fc304455835e8c43ddf4 Mon Sep 17 00:00:00 2001 From: Thomas Witt Date: Mon, 9 Dec 2002 18:09:37 +0000 Subject: [PATCH] Added compatibility workarounds for MW7/8 and MSVC6/7. [SVN r756] --- include/boost/iterator/iterator_adaptors.hpp | 57 +++++++++----------- 1 file changed, 26 insertions(+), 31 deletions(-) diff --git a/include/boost/iterator/iterator_adaptors.hpp b/include/boost/iterator/iterator_adaptors.hpp index 00e53c1..d19ba0b 100644 --- a/include/boost/iterator/iterator_adaptors.hpp +++ b/include/boost/iterator/iterator_adaptors.hpp @@ -1,9 +1,11 @@ #ifndef BOOST_ITERATOR_ADAPTORS_HPP #define BOOST_ITERATOR_ADAPTORS_HPP +#include // for prior #include #include // for prior #include +#include #include #include #include @@ -32,6 +34,16 @@ namespace boost { template struct base { +#ifdef BOOST_MSVC + // Disable enable if for MSVC + typedef T type; + + // This would give a nice error messages containing + // invalid overlaod, but has the big disadvantage that + // there is no reference to user code. + // struct invalid_overload; + // typedef invalid_overload type; +#endif }; }; @@ -48,8 +60,11 @@ namespace boost { class Facade2, class Return> struct enable_if_interoperable : - enabled<(is_interoperable::value)>::template base + enabled< is_interoperable::value >::template base { +#if BOOST_WORKAROUND(BOOST_MSVC, <=1200) + typedef typename enabled< is_interoperable::value >::template base::type type; +#endif }; } // namespace detail @@ -58,8 +73,11 @@ namespace boost { template struct enable_if_convertible : - detail::enabled<(is_convertible::value)>::template base + detail::enabled< is_convertible::value >::template base { +#if BOOST_WORKAROUND(BOOST_MSVC, <=1200) + typedef typename detail::enabled< is_convertible::value >::template base::type type; +#endif }; // @@ -123,6 +141,7 @@ namespace boost { class repository : public iterator { + public: typedef Derived derived_t; }; @@ -142,21 +161,6 @@ namespace boost { } }; -#if 0 - namespace detail { - - template - struct compare_traits : - mpl::if_< is_convertible, - Final1, - Final2 > - { - }; - - } // namespace detail -#endif - template class iterator_comparisons : public Base @@ -370,19 +374,17 @@ namespace boost { { Derived result(this->derived()); return result -= x; } }; - // - // We should provide NTP here // // TODO Handle default arguments the same way as // in former ia lib // template ::value_type, - class Reference = typename std::iterator_traits::reference, - class Pointer = typename std::iterator_traits::pointer, - class Category = typename std::iterator_traits::iterator_category, - class Distance = typename std::iterator_traits::difference_type> + class Value = typename detail::iterator_traits::value_type, + class Reference = typename detail::iterator_traits::reference, + class Pointer = typename detail::iterator_traits::pointer, + class Category = typename detail::iterator_traits::iterator_category, + class Distance = typename detail::iterator_traits::difference_type> class iterator_adaptor : public iterator_facade 1300 -# define BOOST_ARG_DEPENDENT_TYPENAME typename -# else -# define BOOST_ARG_DEPENDENT_TYPENAME -# endif - struct unspecified {}; namespace detail