Fixing "C4127: conditional expression is constant" Visual Studio 2022 warning in pedantic mode (#2783)

This commit is contained in:
Ivan Shynkarenka 2022-02-21 09:26:16 -06:00 committed by GitHub
parent 4fcacea354
commit 1a18a2f3dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2260,7 +2260,7 @@ FMT_CONSTEXPR20 auto write(OutputIt out, T value,
precision = 1;
}
if (const_check(std::is_same<T, float>())) fspecs.binary32 = true;
if (!std::numeric_limits<T>::is_iec559 || std::numeric_limits<T>::digits > 64)
if (const_check(!std::numeric_limits<T>::is_iec559 || std::numeric_limits<T>::digits > 64))
fspecs.fallback = true;
int exp = format_float(convert_float(value), precision, fspecs, buffer);
fspecs.precision = precision;