// (C) Copyright John Maddock 2015. // Use, modification and distribution are subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt). // // See http://www.boost.org/libs/type_traits for most recent version including documentation. #ifndef BOOST_TT_IS_CONSTRUCTIBLE_HPP_INCLUDED #define BOOST_TT_IS_CONSTRUCTIBLE_HPP_INCLUDED #include #include #if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) && !defined(BOOST_NO_CXX11_DECLTYPE) && !BOOST_WORKAROUND(BOOST_MSVC, < 1800) && !BOOST_WORKAROUND(BOOST_GCC_VERSION, < 40500) #include #include #include #include namespace boost{ namespace detail{ struct is_constructible_imp { template()...))> static boost::type_traits::yes_type test(int); template static boost::type_traits::no_type test(...); template()))> static boost::type_traits::yes_type test1(int); template static boost::type_traits::no_type test1(...); template static boost::type_traits::yes_type ref_test(T); template static boost::type_traits::no_type ref_test(...); }; } template struct is_constructible : public integral_constant(0)) == sizeof(boost::type_traits::yes_type)>{}; template struct is_constructible : public integral_constant::value && sizeof(detail::is_constructible_imp::test1(0)) == sizeof(boost::type_traits::yes_type)>{}; template struct is_constructible : public integral_constant(boost::declval())) == sizeof(boost::type_traits::yes_type)>{}; template struct is_constructible : public integral_constant(boost::declval())) == sizeof(boost::type_traits::yes_type)>{}; template <> struct is_constructible : public false_type{}; template <> struct is_constructible : public false_type{}; template <> struct is_constructible : public false_type{}; template <> struct is_constructible : public false_type{}; template struct is_constructible : public is_default_constructible{}; #else #include #include namespace boost{ // We don't know how to implement this: template struct is_constructible : public is_convertible{}; template struct is_constructible : public is_default_constructible{}; template <> struct is_constructible : public false_type{}; template <> struct is_constructible : public false_type{}; template <> struct is_constructible : public false_type{}; template <> struct is_constructible : public false_type{}; template struct is_constructible : public false_type{}; #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES template struct is_constructible : public false_type{}; #endif #endif } // namespace boost #endif // BOOST_TT_IS_CONSTRUCTIBLE_HPP_INCLUDED