#include #include #include #include #include #include #include #include #include #ifndef BOOST_IS_CONSTRUCTIBLE_ARITY_MAX #define BOOST_IS_CONSTRUCTIBLE_ARITY_MAX 5 #endif namespace boost { namespace type_traits_detail { template T declval(); typedef char true_type; struct false_type { char a[2]; }; template struct dummy; } template struct is_constructible; #ifndef BOOST_NO_SFINAE_EXPR #define M1(z,n,t) type_traits_detail::declval() #define M0(z,n,t) \ template \ struct is_constructible \ { \ template \ static type_traits_detail::true_type \ test(type_traits_detail::dummy*); \ \ template \ static type_traits_detail::false_type \ test(...); \ \ static const bool value = sizeof(test(0)) == sizeof(type_traits_detail::true_type); \ typedef boost::mpl::bool_ type; \ }; BOOST_PP_REPEAT(BOOST_IS_CONSTRUCTIBLE_ARITY_MAX, M0, ~) #undef M0 #undef M1 #else #define M0(z,n,t) \ template \ struct is_constructible \ : boost::mpl::false_ \ { \ }; BOOST_PP_REPEAT(BOOST_IS_CONSTRUCTIBLE_ARITY_MAX, M0, ~) #undef M0 #endif } #include struct test { test(int& i) {} }; int main() { std::cout << boost::is_constructible::value << std::endl; std::cout << boost::is_constructible::value << std::endl; }