From 2dc58f1b609ba43241b6c7a68dcd37fdb67e8c2a Mon Sep 17 00:00:00 2001 From: Ivan Shynkarenka Date: Tue, 22 Oct 2019 18:45:22 +0300 Subject: [PATCH] Use const_check to silence constexpr warning --- include/fmt/format.h | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/include/fmt/format.h b/include/fmt/format.h index 14cce727..c505520b 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -2809,11 +2809,7 @@ void internal::basic_writer::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' &&