Fix 32 bit constexpr failures

This commit is contained in:
Peter Dimov 2023-05-30 04:32:23 +03:00
parent 049d3447ca
commit 6c7edac9b1

View File

@ -241,6 +241,15 @@ inline int countl_impl( boost::uint64_t x ) BOOST_NOEXCEPT
}
}
#elif defined(_MSC_VER) && defined(BOOST_CORE_HAS_BUILTIN_ISCONSTEVAL)
BOOST_CXX14_CONSTEXPR inline int countl_impl( boost::uint64_t x ) BOOST_NOEXCEPT
{
return static_cast<boost::uint32_t>( x >> 32 ) != 0?
boost::core::detail::countl_impl( static_cast<boost::uint32_t>( x >> 32 ) ):
boost::core::detail::countl_impl( static_cast<boost::uint32_t>( x ) ) + 32;
}
#else
inline int countl_impl( boost::uint64_t x ) BOOST_NOEXCEPT
@ -457,6 +466,15 @@ inline int countr_impl( boost::uint64_t x ) BOOST_NOEXCEPT
}
}
#elif defined(_MSC_VER) && defined(BOOST_CORE_HAS_BUILTIN_ISCONSTEVAL)
BOOST_CXX14_CONSTEXPR inline int countr_impl( boost::uint64_t x ) BOOST_NOEXCEPT
{
return static_cast<boost::uint32_t>( x ) != 0?
boost::core::detail::countr_impl( static_cast<boost::uint32_t>( x ) ):
boost::core::detail::countr_impl( static_cast<boost::uint32_t>( x >> 32 ) ) + 32;
}
#else
inline int countr_impl( boost::uint64_t x ) BOOST_NOEXCEPT