diff --git a/include/boost/type_traits/has_trivial_constructor.hpp b/include/boost/type_traits/has_trivial_constructor.hpp index 60ac52a..3fca9bf 100644 --- a/include/boost/type_traits/has_trivial_constructor.hpp +++ b/include/boost/type_traits/has_trivial_constructor.hpp @@ -24,17 +24,34 @@ #endif #endif + +#if (defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 409)) || defined(BOOST_CLANG) +#include +#define BOOST_TT_TRIVIAL_CONSTRUCT_FIX && is_default_constructible::value +#else +// +// Mot all compilers, particularly older GCC versions can handle the fix above. +#define BOOST_TT_TRIVIAL_CONSTRUCT_FIX +#endif + namespace boost { template struct has_trivial_constructor #ifdef BOOST_HAS_TRIVIAL_CONSTRUCTOR - : public integral_constant ::value || BOOST_HAS_TRIVIAL_CONSTRUCTOR(T)) && is_default_constructible::value)>{}; + : public integral_constant ::value || BOOST_HAS_TRIVIAL_CONSTRUCTOR(T)) BOOST_TT_TRIVIAL_CONSTRUCT_FIX)>{}; #else : public integral_constant ::value>{}; #endif +template <> struct has_trivial_constructor : public boost::false_type{}; +template <> struct has_trivial_constructor : public boost::false_type{}; +template <> struct has_trivial_constructor : public boost::false_type{}; +template <> struct has_trivial_constructor : public boost::false_type{}; + template struct has_trivial_default_constructor : public has_trivial_constructor {}; +#undef BOOST_TT_TRIVIAL_CONSTRUCT_FIX + } // namespace boost #endif // BOOST_TT_HAS_TRIVIAL_CONSTRUCTOR_HPP_INCLUDED