is_endian_independent.hpp 623 B

1234567891011121314151617181920212223242526272829
  1. #ifndef BOOST_HASH2_IS_ENDIAN_INDEPENDENT_HPP_INCLUDED
  2. #define BOOST_HASH2_IS_ENDIAN_INDEPENDENT_HPP_INCLUDED
  3. // Copyright 2017, 2023, 2024 Peter Dimov
  4. // Distributed under the Boost Software License, Version 1.0.
  5. // https://www.boost.org/LICENSE_1_0.txt
  6. #include <type_traits>
  7. namespace boost
  8. {
  9. namespace hash2
  10. {
  11. template<class T> struct is_endian_independent:
  12. std::integral_constant< bool, sizeof(T) == 1 >
  13. {
  14. };
  15. template<class T> struct is_endian_independent<T const>:
  16. is_endian_independent<T>
  17. {
  18. };
  19. } // namespace hash2
  20. } // namespace boost
  21. #endif // #ifndef BOOST_HASH2_IS_ENDIAN_INDEPENDENT_HPP_INCLUDED