1 // Copyright David Abrahams 2003. Permission to copy, use,
2 // modify, sell and distribute this software is granted provided this
3 // copyright notice appears in all copies. This software is provided
4 // "as is" without express or implied warranty, and with no claim as
5 // to its suitability for any purpose.
6 #ifndef IS_XXX_DWA2003224_HPP
7 # define IS_XXX_DWA2003224_HPP
9 # include <boost/config.hpp>
10 # include <boost/mpl/bool.hpp>
11 # include <boost/preprocessor/enum_params.hpp>
13 # if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
14 # include <boost/type_traits/is_reference.hpp>
15 # include <boost/type_traits/add_reference.hpp>
17 # define BOOST_PYTHON_IS_XXX_DEF(name, qualified_name, nargs) \
22 typedef char (&no)[2]; \
24 static typename add_reference<X_>::type dummy; \
28 template < BOOST_PP_ENUM_PARAMS_Z(1, nargs, class U) > \
30 qualified_name< BOOST_PP_ENUM_PARAMS_Z(1, nargs, U) >&, int \
34 static no test(U&, ...); \
37 BOOST_STATIC_CONSTANT( \
39 = !is_reference<X_>::value \
40 & (sizeof(helpers::test(dummy, 0)) == sizeof(yes))); \
42 typedef mpl::bool_<value> type; \
47 # define BOOST_PYTHON_IS_XXX_DEF(name, qualified_name, nargs) \
49 struct is_##name : mpl::false_ \
53 template < BOOST_PP_ENUM_PARAMS_Z(1, nargs, class T) > \
55 qualified_name< BOOST_PP_ENUM_PARAMS_Z(1, nargs, T) > \
63 #endif // IS_XXX_DWA2003224_HPP