annotate DEPENDENCIES/generic/include/boost/python/detail/convertible.hpp @ 125:34e428693f5d vext

Vext -> Repoint
author Chris Cannam
date Thu, 14 Jun 2018 11:15:39 +0100
parents 2665513ce2d3
children
rev   line source
Chris@16 1 // Copyright David Abrahams 2002.
Chris@16 2 // Distributed under the Boost Software License, Version 1.0. (See
Chris@16 3 // accompanying file LICENSE_1_0.txt or copy at
Chris@16 4 // http://www.boost.org/LICENSE_1_0.txt)
Chris@16 5 #ifndef CONVERTIBLE_DWA2002614_HPP
Chris@16 6 # define CONVERTIBLE_DWA2002614_HPP
Chris@16 7
Chris@16 8 # if defined(__EDG_VERSION__) && __EDG_VERSION__ <= 241
Chris@16 9 # include <boost/mpl/if.hpp>
Chris@16 10 # include <boost/type_traits/conversion_traits.hpp>
Chris@16 11 # endif
Chris@16 12
Chris@16 13 // Supplies a runtime is_convertible check which can be used with tag
Chris@16 14 // dispatching to work around the Metrowerks Pro7 limitation with boost::is_convertible
Chris@16 15 namespace boost { namespace python { namespace detail {
Chris@16 16
Chris@16 17 typedef char* yes_convertible;
Chris@16 18 typedef int* no_convertible;
Chris@16 19
Chris@16 20 template <class Target>
Chris@16 21 struct convertible
Chris@16 22 {
Chris@16 23 # if !defined(__EDG_VERSION__) || __EDG_VERSION__ > 241 || __EDG_VERSION__ == 238
Chris@16 24 static inline no_convertible check(...) { return 0; }
Chris@16 25 static inline yes_convertible check(Target) { return 0; }
Chris@16 26 # else
Chris@16 27 template <class X>
Chris@16 28 static inline typename mpl::if_c<
Chris@16 29 is_convertible<X,Target>::value
Chris@16 30 , yes_convertible
Chris@16 31 , no_convertible
Chris@16 32 >::type check(X const&) { return 0; }
Chris@16 33 # endif
Chris@16 34 };
Chris@16 35
Chris@16 36 }}} // namespace boost::python::detail
Chris@16 37
Chris@16 38 #endif // CONVERTIBLE_DWA2002614_HPP