1 // Copyright David Abrahams 2005. Distributed under the Boost
\r
2 // Software License, Version 1.0. (See accompanying
\r
3 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
\r
4 #ifndef BOOST_DETAIL_IS_XXX_DWA20051011_HPP
\r
5 # define BOOST_DETAIL_IS_XXX_DWA20051011_HPP
\r
7 # include <boost/config.hpp>
\r
8 # include <boost/mpl/bool.hpp>
\r
9 # include <boost/preprocessor/enum_params.hpp>
\r
11 # if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
\r
12 # include <boost/type_traits/is_reference.hpp>
\r
13 # include <boost/type_traits/add_reference.hpp>
\r
15 # define BOOST_DETAIL_IS_XXX_DEF(name, qualified_name, nargs) \
\r
16 template <class X_> \
\r
20 typedef char (&no)[2]; \
\r
22 static typename add_reference<X_>::type dummy; \
\r
26 template < BOOST_PP_ENUM_PARAMS_Z(1, nargs, class U) > \
\r
28 qualified_name< BOOST_PP_ENUM_PARAMS_Z(1, nargs, U) >&, int \
\r
31 template <class U> \
\r
32 static no test(U&, ...); \
\r
35 BOOST_STATIC_CONSTANT( \
\r
37 = !is_reference<X_>::value \
\r
38 & (sizeof(helpers::test(dummy, 0)) == sizeof(yes))); \
\r
40 typedef mpl::bool_<value> type; \
\r
45 # define BOOST_DETAIL_IS_XXX_DEF(name, qualified_name, nargs) \
\r
46 template <class T> \
\r
47 struct is_##name : mpl::false_ \
\r
51 template < BOOST_PP_ENUM_PARAMS_Z(1, nargs, class T) > \
\r
53 qualified_name< BOOST_PP_ENUM_PARAMS_Z(1, nargs, T) > \
\r
61 #endif // BOOST_DETAIL_IS_XXX_DWA20051011_HPP
\r