1 // (C) Copyright David Abrahams 2002.
2 // (C) Copyright Jeremy Siek 2002.
3 // (C) Copyright Thomas Witt 2002.
4 // Permission to copy, use, modify,
5 // sell and distribute this software is granted provided this
6 // copyright notice appears in all copies. This software is provided
7 // "as is" without express or implied warranty, and with no claim as
8 // to its suitability for any purpose.
9 #ifndef BOOST_INTEROPERABLE_23022003THW_HPP
10 # define BOOST_INTEROPERABLE_23022003THW_HPP
12 # include <boost/mpl/bool.hpp>
13 # include <boost/mpl/or.hpp>
15 # include <boost/type_traits/is_convertible.hpp>
17 # include <boost/iterator/detail/config_def.hpp> // must appear last
23 // Meta function that determines whether two
24 // iterator types are considered interoperable.
26 // Two iterator types A,B are considered interoperable if either
27 // A is convertible to B or vice versa.
28 // This interoperability definition is in sync with the
29 // standards requirements on constant/mutable container
30 // iterators (23.1 [lib.container.requirements]).
32 // For compilers that don't support is_convertible
33 // is_interoperable gives false positives. See comments
34 // on operator implementation for consequences.
36 template <typename A, typename B>
37 struct is_interoperable
38 # ifdef BOOST_NO_STRICT_ITERATOR_INTEROPERABILITY
42 is_convertible< A, B >
43 , is_convertible< B, A > >
50 # include <boost/iterator/detail/config_undef.hpp>
52 #endif // BOOST_INTEROPERABLE_23022003THW_HPP