Chris@16: // (C) Copyright David Abrahams 2002. Chris@16: // (C) Copyright Jeremy Siek 2002. Chris@16: // (C) Copyright Thomas Witt 2002. Chris@16: // Distributed under the Boost Software License, Version 1.0. (See Chris@16: // accompanying file LICENSE_1_0.txt or copy at Chris@16: // http://www.boost.org/LICENSE_1_0.txt) Chris@16: #ifndef BOOST_INTEROPERABLE_23022003THW_HPP Chris@16: # define BOOST_INTEROPERABLE_23022003THW_HPP Chris@16: Chris@16: # include Chris@16: # include Chris@16: Chris@16: # include Chris@16: Chris@16: # include // must appear last Chris@16: Chris@101: namespace boost { Chris@101: namespace iterators { Chris@16: Chris@16: // Chris@16: // Meta function that determines whether two Chris@16: // iterator types are considered interoperable. Chris@16: // Chris@16: // Two iterator types A,B are considered interoperable if either Chris@16: // A is convertible to B or vice versa. Chris@16: // This interoperability definition is in sync with the Chris@16: // standards requirements on constant/mutable container Chris@16: // iterators (23.1 [lib.container.requirements]). Chris@16: // Chris@101: // For compilers that don't support is_convertible Chris@16: // is_interoperable gives false positives. See comments Chris@16: // on operator implementation for consequences. Chris@16: // Chris@16: template Chris@16: struct is_interoperable Chris@16: # ifdef BOOST_NO_STRICT_ITERATOR_INTEROPERABILITY Chris@16: : mpl::true_ Chris@16: # else Chris@16: : mpl::or_< Chris@16: is_convertible< A, B > Chris@16: , is_convertible< B, A > > Chris@16: # endif Chris@101: { Chris@16: }; Chris@16: Chris@101: } // namespace iterators Chris@101: Chris@101: using iterators::is_interoperable; Chris@101: Chris@16: } // namespace boost Chris@16: Chris@16: # include Chris@16: Chris@16: #endif // BOOST_INTEROPERABLE_23022003THW_HPP