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 13 #if !defined(BOOST_NO_CXX11_HDR_TYPE_TRAITS) 14 # include <type_traits> 15 #endif 16 17 namespace boost 18 { 19 namespace endian 20 { 21 namespace detail 22 { 23 24 #if !defined(BOOST_NO_CXX11_HDR_TYPE_TRAITS) 25 26 using std::is_trivially_copyable; 27 28 #else 29 30 template<class T> struct is_trivially_copyable: boost::integral_constant<bool, 31 boost::has_trivial_copy<T>::value && boost::has_trivial_assign<T>::value> {}; 32 33 #endif 34 35 } // namespace detail 36 } // namespace endian 37 } // namespace boost 38 39 #endif // BOOST_ENDIAN_DETAIL_IS_TRIVIALLY_COPYABLE_HPP_INCLUDED 40