Files
boost_iterator/include/boost/iterator/interoperable.hpp
T

42 lines
1.3 KiB
C++
Raw Normal View History

2003-07-07 14:14:36 +00:00
// (C) Copyright David Abrahams 2002.
// (C) Copyright Jeremy Siek 2002.
// (C) Copyright Thomas Witt 2002.
2004-08-12 17:13:07 +00:00
// 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)
2003-07-07 14:14:36 +00:00
#ifndef BOOST_INTEROPERABLE_23022003THW_HPP
# define BOOST_INTEROPERABLE_23022003THW_HPP
# include <boost/iterator/detail/type_traits/disjunction.hpp>
2003-07-07 14:14:36 +00:00
namespace boost {
namespace iterators {
2003-07-07 14:14:36 +00:00
//
// Meta function that determines whether two
// iterator types are considered interoperable.
//
// Two iterator types A,B are considered interoperable if either
// A is convertible to B or vice versa.
// This interoperability definition is in sync with the
// standards requirements on constant/mutable container
// iterators (23.1 [lib.container.requirements]).
//
// For compilers that don't support is_convertible
2003-07-07 14:14:36 +00:00
// is_interoperable gives false positives. See comments
// on operator implementation for consequences.
//
template <typename A, typename B>
struct is_interoperable
: detail::disjunction<std::is_convertible<A, B>, std::is_convertible<B, A>>
{
2003-07-07 14:14:36 +00:00
};
} // namespace iterators
using iterators::is_interoperable;
2003-07-07 14:14:36 +00:00
} // namespace boost
#endif // BOOST_INTEROPERABLE_23022003THW_HPP