is_trivially_copyable.hpp 1017 B

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