sl@0: // Copyright David Abrahams 2005. Distributed under the Boost sl@0: // Software License, Version 1.0. (See accompanying sl@0: // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) sl@0: #ifndef BOOST_DETAIL_IS_XXX_DWA20051011_HPP sl@0: # define BOOST_DETAIL_IS_XXX_DWA20051011_HPP sl@0: sl@0: # include sl@0: # include sl@0: # include sl@0: sl@0: # if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) sl@0: # include sl@0: # include sl@0: sl@0: # define BOOST_DETAIL_IS_XXX_DEF(name, qualified_name, nargs) \ sl@0: template \ sl@0: struct is_##name \ sl@0: { \ sl@0: typedef char yes; \ sl@0: typedef char (&no)[2]; \ sl@0: \ sl@0: static typename add_reference::type dummy; \ sl@0: \ sl@0: struct helpers \ sl@0: { \ sl@0: template < BOOST_PP_ENUM_PARAMS_Z(1, nargs, class U) > \ sl@0: static yes test( \ sl@0: qualified_name< BOOST_PP_ENUM_PARAMS_Z(1, nargs, U) >&, int \ sl@0: ); \ sl@0: \ sl@0: template \ sl@0: static no test(U&, ...); \ sl@0: }; \ sl@0: \ sl@0: BOOST_STATIC_CONSTANT( \ sl@0: bool, value \ sl@0: = !is_reference::value \ sl@0: & (sizeof(helpers::test(dummy, 0)) == sizeof(yes))); \ sl@0: \ sl@0: typedef mpl::bool_ type; \ sl@0: }; sl@0: sl@0: # else sl@0: sl@0: # define BOOST_DETAIL_IS_XXX_DEF(name, qualified_name, nargs) \ sl@0: template \ sl@0: struct is_##name : mpl::false_ \ sl@0: { \ sl@0: }; \ sl@0: \ sl@0: template < BOOST_PP_ENUM_PARAMS_Z(1, nargs, class T) > \ sl@0: struct is_##name< \ sl@0: qualified_name< BOOST_PP_ENUM_PARAMS_Z(1, nargs, T) > \ sl@0: > \ sl@0: : mpl::true_ \ sl@0: { \ sl@0: }; sl@0: sl@0: # endif sl@0: sl@0: #endif // BOOST_DETAIL_IS_XXX_DWA20051011_HPP