From 87d2c99487eef586ce54d432697f384cbe7a50e1 Mon Sep 17 00:00:00 2001 From: Paul Dreik Date: Sun, 9 Jun 2019 17:36:12 +0200 Subject: [PATCH] switch to fmt constexpr macros --- include/fmt/safe_duration_cast.h | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/include/fmt/safe_duration_cast.h b/include/fmt/safe_duration_cast.h index 4c1ddd2ac1cb..7deebcf9b3c5 100644 --- a/include/fmt/safe_duration_cast.h +++ b/include/fmt/safe_duration_cast.h @@ -16,15 +16,6 @@ #include "format.h" -// see -// https://en.cppreference.com/w/User:D41D8CD98F/feature_testing_macros#C.2B.2B17 - -#if __cpp_constexpr >= 201304 -# define SDC_RELAXED_CONSTEXPR constexpr -#else -# define SDC_RELAXED_CONSTEXPR -#endif - FMT_BEGIN_NAMESPACE namespace safe_duration_cast { @@ -35,8 +26,7 @@ namespace safe_duration_cast { */ template ::value)> -SDC_RELAXED_CONSTEXPR To lossless_integral_conversion(const From from, - int& ec) { +FMT_CONSTEXPR To lossless_integral_conversion(const From from, int& ec) { ec = 0; using F = std::numeric_limits; using T = std::numeric_limits; @@ -97,8 +87,7 @@ SDC_RELAXED_CONSTEXPR To lossless_integral_conversion(const From from, template ::value)> -SDC_RELAXED_CONSTEXPR To lossless_integral_conversion(const From from, - int& ec) { +FMT_CONSTEXPR To lossless_integral_conversion(const From from, int& ec) { ec = 0; return from; } // function @@ -116,7 +105,7 @@ SDC_RELAXED_CONSTEXPR To lossless_integral_conversion(const From from, */ template ::value)> -SDC_RELAXED_CONSTEXPR To safe_float_conversion(const From from, int& ec) { +FMT_CONSTEXPR To safe_float_conversion(const From from, int& ec) { ec = 0; using T = std::numeric_limits; static_assert(std::is_floating_point::value, "From must be floating"); @@ -138,7 +127,7 @@ SDC_RELAXED_CONSTEXPR To safe_float_conversion(const From from, int& ec) { template ::value)> -SDC_RELAXED_CONSTEXPR To safe_float_conversion(const From from, int& ec) { +FMT_CONSTEXPR To safe_float_conversion(const From from, int& ec) { ec = 0; static_assert(std::is_floating_point::value, "From must be floating"); return from;