From 8271e43e5e8ddef3e6cd00609da8025b5936b262 Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Sun, 20 Mar 2022 07:20:41 -0700 Subject: [PATCH] Improve __float128 support and use constexpr --- include/fmt/format.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/include/fmt/format.h b/include/fmt/format.h index de73eae1..2d18621a 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -950,19 +950,19 @@ using is_signed = // Returns true if value is negative, false otherwise. // Same as `value < 0` but doesn't produce warnings if T is an unsigned type. template ::value)> -FMT_CONSTEXPR auto is_negative(T value) -> bool { +constexpr auto is_negative(T value) -> bool { return value < 0; } template ::value)> -FMT_CONSTEXPR auto is_negative(T) -> bool { +constexpr auto is_negative(T) -> bool { return false; } -template -FMT_CONSTEXPR auto is_supported_floating_point(T) -> uint16_t { - return (std::is_same::value && FMT_USE_FLOAT) || - (std::is_same::value && FMT_USE_DOUBLE) || - (std::is_same::value && FMT_USE_LONG_DOUBLE); +template constexpr auto is_supported_floating_point(T) -> bool { + return (std::is_same() && FMT_USE_FLOAT) || + (std::is_same() && FMT_USE_DOUBLE) || + (std::is_same() && FMT_USE_LONG_DOUBLE) || + is_float128(); } // Smallest of uint32_t, uint64_t, uint128_t that is large enough to