diff --git a/include/boost/endian/detail/endian_reverse.hpp b/include/boost/endian/detail/endian_reverse.hpp index ce73b04..850445b 100644 --- a/include/boost/endian/detail/endian_reverse.hpp +++ b/include/boost/endian/detail/endian_reverse.hpp @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include @@ -103,14 +104,14 @@ inline __uint128_t BOOST_ENDIAN_CONSTEXPR endian_reverse_impl( __uint128_t x ) B // is_endian_reversible template struct is_endian_reversible: std::integral_constant::value && !std::is_same::value) || is_scoped_enum::value> + (is_integral::value && !std::is_same::value) || is_scoped_enum::value> { }; // is_endian_reversible_inplace template struct is_endian_reversible_inplace: std::integral_constant::value || std::is_enum::value || std::is_same::value || std::is_same::value> + is_integral::value || std::is_enum::value || std::is_same::value || std::is_same::value> { }; diff --git a/include/boost/endian/detail/is_integral.hpp b/include/boost/endian/detail/is_integral.hpp new file mode 100644 index 0000000..06b8d8b --- /dev/null +++ b/include/boost/endian/detail/is_integral.hpp @@ -0,0 +1,37 @@ +#ifndef BOOST_ENDIAN_DETAIL_IS_INTEGRAL_HPP_INCLUDED +#define BOOST_ENDIAN_DETAIL_IS_INTEGRAL_HPP_INCLUDED + +// Copyright 2023 Peter Dimov +// Distributed under the Boost Software License, Version 1.0. +// http://www.boost.org/LICENSE_1_0.txt + +#include + +namespace boost +{ +namespace endian +{ +namespace detail +{ + +template struct is_integral: std::is_integral +{ +}; + +#if defined(__SIZEOF_INT128__) + +template<> struct is_integral<__int128_t>: std::true_type +{ +}; + +template<> struct is_integral<__uint128_t>: std::true_type +{ +}; + +#endif + +} // namespace detail +} // namespace endian +} // namespace boost + +#endif // BOOST_ENDIAN_DETAIL_IS_INTEGRAL_HPP_INCLUDED