// (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_DEFAULT_CONSTRUCTIBLE_HPP_INCLUDED #define BOOST_TT_IS_DEFAULT_CONSTRUCTIBLE_HPP_INCLUDED #include // size_t #include #include #if BOOST_WORKAROUND(BOOST_GCC_VERSION, < 40700) #include #endif #if !defined(BOOST_NO_CXX11_DECLTYPE) && !BOOST_WORKAROUND(BOOST_MSVC, < 1800) && !BOOST_WORKAROUND(BOOST_GCC_VERSION, < 40500) #include namespace boost{ namespace detail{ struct is_default_constructible_imp { template static boost::type_traits::yes_type test(int); template static boost::type_traits::no_type test(...); }; #if BOOST_WORKAROUND(BOOST_GCC_VERSION, < 40700) template struct is_default_constructible_abstract_filter { static const bool value = sizeof(is_default_constructible_imp::test(0)) == sizeof(boost::type_traits::yes_type); }; template struct is_default_constructible_abstract_filter { static const bool value = false; }; #endif } #if BOOST_WORKAROUND(BOOST_GCC_VERSION, < 40700) template struct is_default_constructible : public integral_constant::value>::value>{}; #else template struct is_default_constructible : public integral_constant(0)) == sizeof(boost::type_traits::yes_type)>{}; #endif template struct is_default_constructible : public is_default_constructible{}; template struct is_default_constructible : public is_default_constructible{}; template struct is_default_constructible : public integral_constant{}; #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) template struct is_default_constructible : public integral_constant{}; #endif template <> struct is_default_constructible : public integral_constant{}; template <> struct is_default_constructible : public integral_constant{}; template <> struct is_default_constructible : public integral_constant{}; template <> struct is_default_constructible : public integral_constant{}; #else #include namespace boost{ // We don't know how to implement this, note we can not use has_trivial_constructor here // because the correct implementation of that trait requires this one: template struct is_default_constructible : public is_pod{}; template <> struct is_default_constructible : public integral_constant{}; template <> struct is_default_constructible : public integral_constant{}; template <> struct is_default_constructible : public integral_constant{}; template <> struct is_default_constructible : public integral_constant{}; #endif } // namespace boost #endif // BOOST_TT_IS_DEFAULT_CONSTRUCTIBLE_HPP_INCLUDED