X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=boost%2Fboost%2Fiterator%2Fiterator_adaptor.hpp;h=9f2fbb0efef15d723abaed46d055a7a70419fc76;hb=c48091f33a773732fa6c789927e5833e44108d9d;hp=77d9990aa8a484e36d002223dd642c3c8165d101;hpb=786216c0899498434cab9f33780f9c178a0a4006;p=lyx.git diff --git a/boost/boost/iterator/iterator_adaptor.hpp b/boost/boost/iterator/iterator_adaptor.hpp index 77d9990aa8..9f2fbb0efe 100644 --- a/boost/boost/iterator/iterator_adaptor.hpp +++ b/boost/boost/iterator/iterator_adaptor.hpp @@ -1,11 +1,9 @@ // (C) Copyright David Abrahams 2002. // (C) Copyright Jeremy Siek 2002. // (C) Copyright Thomas Witt 2002. -// Permission to copy, use, modify, -// sell and distribute this software is granted provided this -// copyright notice appears in all copies. This software is provided -// "as is" without express or implied warranty, and with no claim as -// to its suitability for any purpose. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_ITERATOR_ADAPTOR_23022003THW_HPP #define BOOST_ITERATOR_ADAPTOR_23022003THW_HPP @@ -21,17 +19,14 @@ #include #include -#include - #include #include #ifdef BOOST_ITERATOR_REF_CONSTNESS_KILLS_WRITABILITY # include -#else -# include -#endif +#endif +#include #include #include @@ -104,12 +99,27 @@ namespace boost // false positives for user/library defined iterator types. See comments // on operator implementation for consequences. // -# if defined(BOOST_NO_IS_CONVERTIBLE) || defined(BOOST_NO_SFINAE) +# if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) + + template + struct enable_if_convertible + { + typedef typename mpl::if_< + mpl::or_< + is_same + , is_convertible + > + , boost::detail::enable_type + , int& + >::type type; + }; + +# elif defined(BOOST_NO_IS_CONVERTIBLE) || defined(BOOST_NO_SFINAE) template struct enable_if_convertible { - typedef detail::enable_type type; + typedef boost::detail::enable_type type; }; # elif BOOST_WORKAROUND(_MSC_FULL_VER, BOOST_TESTED_AT(13102292)) && BOOST_MSVC > 1300 @@ -123,7 +133,7 @@ namespace boost is_same , is_convertible > - , detail::enable_type + , boost::detail::enable_type > {}; @@ -133,7 +143,7 @@ namespace boost struct enable_if_convertible : iterators::enable_if< is_convertible - , detail::enable_type + , boost::detail::enable_type > {}; @@ -148,7 +158,7 @@ namespace boost // DefaultNullaryFn, otherwise return T. template struct ia_dflt_help - : mpl::apply_if< + : mpl::eval_if< is_same , DefaultNullaryFn , mpl::identity @@ -172,41 +182,47 @@ namespace boost Derived # ifdef BOOST_ITERATOR_REF_CONSTNESS_KILLS_WRITABILITY - , typename detail::ia_dflt_help< + , typename boost::detail::ia_dflt_help< Value - , mpl::apply_if< + , mpl::eval_if< is_same , iterator_value , remove_reference > >::type # else - , typename detail::ia_dflt_help< + , typename boost::detail::ia_dflt_help< Value, iterator_value >::type # endif - , typename detail::ia_dflt_help< + , typename boost::detail::ia_dflt_help< Traversal , iterator_traversal >::type - , typename detail::ia_dflt_help< + , typename boost::detail::ia_dflt_help< Reference - , mpl::apply_if< + , mpl::eval_if< is_same , iterator_reference , add_reference > >::type - , typename detail::ia_dflt_help< + , typename boost::detail::ia_dflt_help< Difference, iterator_difference >::type > type; }; - template int static_assert_convertible_to(T); + + // workaround for aC++ CR JAGaf33512 + template + inline void iterator_adaptor_assert_traversal () + { + BOOST_STATIC_ASSERT((is_convertible::value)); + } } // @@ -243,16 +259,16 @@ namespace boost , class Difference = use_default > class iterator_adaptor - : public detail::iterator_adaptor_base< + : public boost::detail::iterator_adaptor_base< Derived, Base, Value, Traversal, Reference, Difference >::type { friend class iterator_core_access; - typedef typename detail::iterator_adaptor_base< + protected: + typedef typename boost::detail::iterator_adaptor_base< Derived, Base, Value, Traversal, Reference, Difference >::type super_t; - public: iterator_adaptor() {} @@ -261,10 +277,15 @@ namespace boost { } + typedef Base base_type; + Base const& base() const { return m_iterator; } protected: + // for convenience in derived classes + typedef iterator_adaptor iterator_adaptor_; + // // lvalue access to the Base object for Derived // @@ -301,8 +322,7 @@ namespace boost >::type my_traversal; # define BOOST_ITERATOR_ADAPTOR_ASSERT_TRAVERSAL(cat) \ - typedef int assertion[sizeof(detail::static_assert_convertible_to(my_traversal()))]; -// BOOST_STATIC_ASSERT((is_convertible::value)); + boost::detail::iterator_adaptor_assert_traversal(); void advance(typename super_t::difference_type n) {