1
// Copyright David Abrahams 2002.
2
// Distributed under the Boost Software License, Version 1.0. (See
3
// accompanying file LICENSE_1_0.txt or copy at
4
// http://www.boost.org/LICENSE_1_0.txt)
5
#ifndef CONVERTIBLE_DWA2002614_HPP
6
# define CONVERTIBLE_DWA2002614_HPP
8
# if defined(__EDG_VERSION__) && __EDG_VERSION__ <= 241
9
# include <boost/mpl/if.hpp>
10
# include <boost/type_traits/conversion_traits.hpp>
13
// Supplies a runtime is_convertible check which can be used with tag
14
// dispatching to work around the Metrowerks Pro7 limitation with boost::is_convertible
15
namespace boost { namespace python { namespace detail {
17
typedef char* yes_convertible;
18
typedef int* no_convertible;
20
template <class Target>
23
# if !defined(__EDG_VERSION__) || __EDG_VERSION__ > 241 || __EDG_VERSION__ == 238
24
static inline no_convertible check(...) { return 0; }
25
static inline yes_convertible check(Target) { return 0; }
28
static inline typename mpl::if_c<
29
is_convertible<X,Target>::value
32
>::type check(X const&) { return 0; }
36
}}} // namespace boost::python::detail
38
#endif // CONVERTIBLE_DWA2002614_HPP