Fixed compilation of gcd in C++20 mode with clang 10.

Due to the new overload resolution rules for comparison operators in C++20,
the comparison became ambiguous.
This commit is contained in:
Andrey Semashev
2020-05-07 14:35:47 +03:00
parent a6a6b1f064
commit 6bb937fa5f

View File

@ -129,7 +129,7 @@ namespace boost {
BOOST_FORCEINLINE static BOOST_CXX14_CONSTEXPR unsigned make_odd(T& val) BOOST_GCD_NOEXCEPT(T)
{
unsigned r = 0;
while(0 == (val & 1u))
while (T(0) == (val & 1u))
{
#ifdef _MSC_VER // VC++ can't handle operator >>= in constexpr code for some reason
val = val >> 1;