Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:38:55

0001 // (C) Copyright David Abrahams 2002.
0002 // (C) Copyright Jeremy Siek    2002.
0003 // (C) Copyright Thomas Witt    2002.
0004 // Distributed under the Boost Software License, Version 1.0. (See
0005 // accompanying file LICENSE_1_0.txt or copy at
0006 // http://www.boost.org/LICENSE_1_0.txt)
0007 #ifndef BOOST_INTEROPERABLE_23022003THW_HPP
0008 # define BOOST_INTEROPERABLE_23022003THW_HPP
0009 
0010 # include <boost/mpl/bool.hpp>
0011 # include <boost/mpl/or.hpp>
0012 
0013 # include <boost/type_traits/is_convertible.hpp>
0014 
0015 # include <boost/iterator/detail/config_def.hpp> // must appear last
0016 
0017 namespace boost {
0018 namespace iterators {
0019 
0020   //
0021   // Meta function that determines whether two
0022   // iterator types are considered interoperable.
0023   //
0024   // Two iterator types A,B are considered interoperable if either
0025   // A is convertible to B or vice versa.
0026   // This interoperability definition is in sync with the
0027   // standards requirements on constant/mutable container
0028   // iterators (23.1 [lib.container.requirements]).
0029   //
0030   // For compilers that don't support is_convertible
0031   // is_interoperable gives false positives. See comments
0032   // on operator implementation for consequences.
0033   //
0034   template <typename A, typename B>
0035   struct is_interoperable
0036 # ifdef BOOST_NO_STRICT_ITERATOR_INTEROPERABILITY
0037     : mpl::true_
0038 # else
0039     : mpl::or_<
0040           is_convertible< A, B >
0041         , is_convertible< B, A > >
0042 # endif
0043   {
0044   };
0045 
0046 } // namespace iterators
0047 
0048 using iterators::is_interoperable;
0049 
0050 } // namespace boost
0051 
0052 # include <boost/iterator/detail/config_undef.hpp>
0053 
0054 #endif // BOOST_INTEROPERABLE_23022003THW_HPP