|
1 | | -// Copyright David Abrahams 2003. |
| 1 | +// Copyright David Abrahams 2005. |
2 | 2 | // Distributed under the Boost Software License, Version 1.0. (See |
3 | 3 | // accompanying file LICENSE_1_0.txt or copy at |
4 | 4 | // http://www.boost.org/LICENSE_1_0.txt) |
5 | 5 | #ifndef IS_XXX_DWA2003224_HPP |
6 | 6 | # define IS_XXX_DWA2003224_HPP |
7 | 7 |
|
8 | | -# include <boost/config.hpp> |
9 | | -# include <boost/mpl/bool.hpp> |
10 | | -# include <boost/preprocessor/enum_params.hpp> |
| 8 | +# include <boost/detail/is_xxx.hpp> |
11 | 9 |
|
12 | | -# if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) |
13 | | -# include <boost/type_traits/is_reference.hpp> |
14 | | -# include <boost/type_traits/add_reference.hpp> |
15 | | - |
16 | | -# define BOOST_PYTHON_IS_XXX_DEF(name, qualified_name, nargs) \ |
17 | | -template <class X_> \ |
18 | | -struct is_##name \ |
19 | | -{ \ |
20 | | - typedef char yes; \ |
21 | | - typedef char (&no)[2]; \ |
22 | | - \ |
23 | | - static typename add_reference<X_>::type dummy; \ |
24 | | - \ |
25 | | - struct helpers \ |
26 | | - { \ |
27 | | - template < BOOST_PP_ENUM_PARAMS_Z(1, nargs, class U) > \ |
28 | | - static yes test( \ |
29 | | - qualified_name< BOOST_PP_ENUM_PARAMS_Z(1, nargs, U) >&, int \ |
30 | | - ); \ |
31 | | - \ |
32 | | - template <class U> \ |
33 | | - static no test(U&, ...); \ |
34 | | - }; \ |
35 | | - \ |
36 | | - BOOST_STATIC_CONSTANT( \ |
37 | | - bool, value \ |
38 | | - = !is_reference<X_>::value \ |
39 | | - & (sizeof(helpers::test(dummy, 0)) == sizeof(yes))); \ |
40 | | - \ |
41 | | - typedef mpl::bool_<value> type; \ |
42 | | -}; |
43 | | - |
44 | | -# else |
45 | | - |
46 | | -# define BOOST_PYTHON_IS_XXX_DEF(name, qualified_name, nargs) \ |
47 | | -template <class T> \ |
48 | | -struct is_##name : mpl::false_ \ |
49 | | -{ \ |
50 | | -}; \ |
51 | | - \ |
52 | | -template < BOOST_PP_ENUM_PARAMS_Z(1, nargs, class T) > \ |
53 | | -struct is_##name< \ |
54 | | - qualified_name< BOOST_PP_ENUM_PARAMS_Z(1, nargs, T) > \ |
55 | | -> \ |
56 | | - : mpl::true_ \ |
57 | | -{ \ |
58 | | -}; |
59 | | - |
60 | | -# endif |
| 10 | +# define BOOST_PYTHON_IS_XXX_DEF(name, qualified_name, nargs) \ |
| 11 | + BOOST_DETAIL_IS_XXX_DEF(name, qualified_name, nargs) |
61 | 12 |
|
62 | 13 | #endif // IS_XXX_DWA2003224_HPP |
0 commit comments