Update is_trivially_copyable to also check has_trivial_destructor in the fallback case

This commit is contained in:
Peter Dimov
2020-05-02 02:25:15 +03:00
parent e1b7981a53
commit 21eed3fd59

View File

@ -9,6 +9,7 @@
#include <boost/config.hpp>
#include <boost/type_traits/has_trivial_copy.hpp>
#include <boost/type_traits/has_trivial_assign.hpp>
#include <boost/type_traits/has_trivial_destructor.hpp>
#if !defined(BOOST_NO_CXX11_HDR_TYPE_TRAITS)
# include <type_traits>
@ -28,7 +29,7 @@ using std::is_trivially_copyable;
#else
template<class T> struct is_trivially_copyable: boost::integral_constant<bool,
boost::has_trivial_copy<T>::value && boost::has_trivial_assign<T>::value> {};
boost::has_trivial_copy<T>::value && boost::has_trivial_assign<T>::value && boost::has_trivial_destructor<T>::value> {};
#endif