is_integral.hpp 676 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #ifndef BOOST_ENDIAN_DETAIL_IS_INTEGRAL_HPP_INCLUDED
  2. #define BOOST_ENDIAN_DETAIL_IS_INTEGRAL_HPP_INCLUDED
  3. // Copyright 2023 Peter Dimov
  4. // Distributed under the Boost Software License, Version 1.0.
  5. // http://www.boost.org/LICENSE_1_0.txt
  6. #include <type_traits>
  7. namespace boost
  8. {
  9. namespace endian
  10. {
  11. namespace detail
  12. {
  13. template<class T> struct is_integral: std::is_integral<T>
  14. {
  15. };
  16. #if defined(__SIZEOF_INT128__)
  17. template<> struct is_integral<__int128_t>: std::true_type
  18. {
  19. };
  20. template<> struct is_integral<__uint128_t>: std::true_type
  21. {
  22. };
  23. #endif
  24. } // namespace detail
  25. } // namespace endian
  26. } // namespace boost
  27. #endif // BOOST_ENDIAN_DETAIL_IS_INTEGRAL_HPP_INCLUDED