Use const_check to silence constexpr warning

This commit is contained in:
Ivan Shynkarenka 2019-10-22 18:45:22 +03:00
parent 313c48baff
commit 2dc58f1b60

View File

@ -2809,11 +2809,7 @@ void internal::basic_writer<Range>::write_fp(T value,
int precision = specs.precision >= 0 || !specs.type ? specs.precision : 6;
unsigned options = 0;
if (handler.fixed) options |= grisu_options::fixed;
#ifdef __cpp_if_constexpr
if constexpr (sizeof(value) == sizeof(float)) options |= grisu_options::binary32;
#else
if (sizeof(value) == sizeof(float)) options |= grisu_options::binary32;
#endif
if (const_check(sizeof(value) == sizeof(float))) options |= grisu_options::binary32;
bool use_grisu =
USE_GRISU &&
(specs.type != 'a' && specs.type != 'A' && specs.type != 'e' &&