1 #ifndef BOOST_ENDIAN_DETAIL_IS_TRIVIALLY_COPYABLE_HPP_INCLUDED 2 #define BOOST_ENDIAN_DETAIL_IS_TRIVIALLY_COPYABLE_HPP_INCLUDED 3 4 // Copyright 2019 Peter Dimov 5 // 6 // Distributed under the Boost Software License, Version 1.0. 7 // http://www.boost.org/LICENSE_1_0.txt 8 9 #include <boost/config.hpp> 10 #include <boost/type_traits/has_trivial_copy.hpp> 11 #include <boost/type_traits/has_trivial_assign.hpp> 12 #include <boost/type_traits/has_trivial_destructor.hpp> 13 14 #if !defined(BOOST_NO_CXX11_HDR_TYPE_TRAITS) 15 # include <type_traits> 16 #endif 17 18 namespace boost 19 { 20 namespace endian 21 { 22 namespace detail 23 { 24 25 #if !defined(BOOST_NO_CXX11_HDR_TYPE_TRAITS) 26 27 using std::is_trivially_copyable; 28 29 #else 30 31 template<class T> struct is_trivially_copyable: boost::integral_constant<bool, 32 boost::has_trivial_copy<T>::value && boost::has_trivial_assign<T>::value && boost::has_trivial_destructor<T>::value> {}; 33 34 #endif 35 36 } // namespace detail 37 } // namespace endian 38 } // namespace boost 39 40 #endif // BOOST_ENDIAN_DETAIL_IS_TRIVIALLY_COPYABLE_HPP_INCLUDED 41