Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:50:37

0001 // Copyright David Abrahams 2002.
0002 // Distributed under the Boost Software License, Version 1.0. (See
0003 // accompanying file LICENSE_1_0.txt or copy at
0004 // http://www.boost.org/LICENSE_1_0.txt)
0005 #ifndef CONVERTIBLE_DWA2002614_HPP
0006 # define CONVERTIBLE_DWA2002614_HPP
0007 
0008 # if defined(__EDG_VERSION__) && __EDG_VERSION__ <= 241
0009 #  include <boost/mpl/if.hpp>
0010 #  include <boost/python/detail/type_traits.hpp>
0011 # endif 
0012 
0013 // Supplies a runtime is_convertible check which can be used with tag
0014 // dispatching to work around the Metrowerks Pro7 limitation with boost/std::is_convertible
0015 namespace boost { namespace python { namespace detail { 
0016 
0017 typedef char* yes_convertible;
0018 typedef int* no_convertible;
0019 
0020 template <class Target>
0021 struct convertible
0022 {
0023 # if !defined(__EDG_VERSION__) || __EDG_VERSION__ > 241 || __EDG_VERSION__ == 238
0024     static inline no_convertible check(...) { return 0; }
0025     static inline yes_convertible check(Target) { return 0; }
0026 # else
0027     template <class X>
0028     static inline typename mpl::if_c<
0029         is_convertible<X,Target>::value
0030         , yes_convertible
0031         , no_convertible
0032         >::type check(X const&) { return 0; }
0033 # endif 
0034 };
0035 
0036 }}} // namespace boost::python::detail
0037 
0038 #endif // CONVERTIBLE_DWA2002614_HPP