diff --git a/include/boost/type_traits/is_trivially_copyable.hpp b/include/boost/type_traits/is_trivially_copyable.hpp index 468945e..a62668a 100644 --- a/include/boost/type_traits/is_trivially_copyable.hpp +++ b/include/boost/type_traits/is_trivially_copyable.hpp @@ -13,6 +13,8 @@ or copy at http://www.boost.org/LICENSE_1_0.txt) #include #include #include +#include +#include namespace boost { @@ -20,6 +22,8 @@ template struct is_trivially_copyable : integral_constant::value && has_trivial_assign::value && + has_trivial_move_constructor::value && + has_trivial_move_assign::value && has_trivial_destructor::value> { }; } /* boost */ diff --git a/test/is_trivially_copyable_test.cpp b/test/is_trivially_copyable_test.cpp index 3718e51..1fc99d2 100644 --- a/test/is_trivially_copyable_test.cpp +++ b/test/is_trivially_copyable_test.cpp @@ -53,6 +53,17 @@ struct deleted_destruct { }; #endif +#ifndef BOOST_NO_CXX11_DEFAULTED_FUNCTIONS +struct default_copy { + default_copy(const default_copy&) = default; + default_copy(default_copy&&) { } + default_copy& operator=(const default_copy&) = default; + default_copy& operator=(default_copy&&) { + return *this; + } +}; +#endif + TT_TEST_BEGIN(is_trivially_copyable) BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_trivially_copyable::value, true); @@ -215,10 +226,13 @@ BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::is_trivially_copyable >::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_trivially_copyable::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_trivially_copyable::value, false); -BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_trivially_copyable::value, false); #ifndef BOOST_NO_CXX11_DELETED_FUNCTIONS BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_trivially_copyable::value, false); -BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_trivially_copyable::value, false); +#endif +#ifndef BOOST_NO_CXX11_DEFAULTED_FUNCTIONS +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_trivially_copyable::value, false); #endif TT_TEST_END