~tsarev/boostdc/cmake

« back to all changes in this revision

Viewing changes to boost/boost/python/detail/convertible.hpp

  • Committer: bigmuscle
  • Date: 2010-05-08 08:47:15 UTC
  • Revision ID: svn-v4:5fb55d53-692c-0410-a46a-e90ab66e00ee:trunk:497
removed old boost version

Show diffs side-by-side

added added

removed removed

Lines of Context:
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
7
 
 
8
 
# if defined(__EDG_VERSION__) && __EDG_VERSION__ <= 241
9
 
#  include <boost/mpl/if.hpp>
10
 
#  include <boost/type_traits/conversion_traits.hpp>
11
 
# endif 
12
 
 
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 { 
16
 
 
17
 
typedef char* yes_convertible;
18
 
typedef int* no_convertible;
19
 
 
20
 
template <class Target>
21
 
struct convertible
22
 
{
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; }
26
 
# else
27
 
    template <class X>
28
 
    static inline typename mpl::if_c<
29
 
        is_convertible<X,Target>::value
30
 
        , yes_convertible
31
 
        , no_convertible
32
 
        >::type check(X const&) { return 0; }
33
 
# endif 
34
 
};
35
 
 
36
 
}}} // namespace boost::python::detail
37
 
 
38
 
#endif // CONVERTIBLE_DWA2002614_HPP