C++11 compatibility

This commit is contained in:
Kirill Lokotkov 2023-01-25 18:44:28 +03:00 committed by GitHub
parent 1885f4bc5f
commit ee0ceac55d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -833,7 +833,7 @@ class serializer
// the actual conversion
// NOLINTNEXTLINE(cppcoreguidelines-pro-type-vararg,hicpp-vararg)
std::ptrdiff_t len;
if constexpr (std::is_same_v<number_float_t, long double>) {
if (std::is_same<number_float_t, long double>::value) {
len = (std::snprintf)(number_buffer.data(), number_buffer.size(), "%.*Lg", d, x);
} else {
len = (std::snprintf)(number_buffer.data(), number_buffer.size(), "%.*g", d, x);