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