os/ossrv/ossrv_pub/boost_apis/boost/python/detail/convertible.hpp
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/ossrv/ossrv_pub/boost_apis/boost/python/detail/convertible.hpp	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,38 @@
     1.4 +// Copyright David Abrahams 2002.
     1.5 +// Distributed under the Boost Software License, Version 1.0. (See
     1.6 +// accompanying file LICENSE_1_0.txt or copy at
     1.7 +// http://www.boost.org/LICENSE_1_0.txt)
     1.8 +#ifndef CONVERTIBLE_DWA2002614_HPP
     1.9 +# define CONVERTIBLE_DWA2002614_HPP
    1.10 +
    1.11 +# if defined(__EDG_VERSION__) && __EDG_VERSION__ <= 241
    1.12 +#  include <boost/mpl/if.hpp>
    1.13 +#  include <boost/type_traits/conversion_traits.hpp>
    1.14 +# endif 
    1.15 +
    1.16 +// Supplies a runtime is_convertible check which can be used with tag
    1.17 +// dispatching to work around the Metrowerks Pro7 limitation with boost::is_convertible
    1.18 +namespace boost { namespace python { namespace detail { 
    1.19 +
    1.20 +typedef char* yes_convertible;
    1.21 +typedef int* no_convertible;
    1.22 +
    1.23 +template <class Target>
    1.24 +struct convertible
    1.25 +{
    1.26 +# if !defined(__EDG_VERSION__) || __EDG_VERSION__ > 241 || __EDG_VERSION__ == 238
    1.27 +    static inline no_convertible check(...) { return 0; }
    1.28 +    static inline yes_convertible check(Target) { return 0; }
    1.29 +# else
    1.30 +    template <class X>
    1.31 +    static inline typename mpl::if_c<
    1.32 +        is_convertible<X,Target>::value
    1.33 +        , yes_convertible
    1.34 +        , no_convertible
    1.35 +        >::type check(X const&) { return 0; }
    1.36 +# endif 
    1.37 +};
    1.38 +
    1.39 +}}} // namespace boost::python::detail
    1.40 +
    1.41 +#endif // CONVERTIBLE_DWA2002614_HPP