diff --git a/include/fmt/chrono.h b/include/fmt/chrono.h index b2768e7b..bdc33e63 100644 --- a/include/fmt/chrono.h +++ b/include/fmt/chrono.h @@ -376,13 +376,11 @@ struct chrono_format_checker { FMT_NORETURN void on_tz_name() { report_no_date(); } }; -template ::value, int>::type = 0> +template ::value)> inline bool isnan(T) { return false; } -template ::value, - int>::type = 0> +template ::value)> inline bool isnan(T value) { return std::isnan(value); } @@ -394,13 +392,11 @@ template inline int to_int(T value) { return static_cast(value); } -template ::value, int>::type = 0> +template ::value)> inline T mod(T x, int y) { return x % y; } -template ::value, - int>::type = 0> +template ::value)> inline T mod(T x, int y) { return std::fmod(x, y); } diff --git a/include/fmt/core.h b/include/fmt/core.h index 731fe965..54686e2d 100644 --- a/include/fmt/core.h +++ b/include/fmt/core.h @@ -227,7 +227,8 @@ // An enable_if helper to be used in template parameters. enable_if in template // parameters results in much shorter symbols: https://godbolt.org/z/sWw4vP. -#define FMT_ENABLE_IF(...) typename std::enable_if<__VA_ARGS__, int>::type = 0 +#define FMT_ENABLE_IF_T(...) typename std::enable_if<__VA_ARGS__, int>::type +#define FMT_ENABLE_IF(...) FMT_ENABLE_IF_T(__VA_ARGS__) = 0 FMT_BEGIN_NAMESPACE namespace internal { diff --git a/include/fmt/format-inl.h b/include/fmt/format-inl.h index 30df00df..d8956822 100644 --- a/include/fmt/format-inl.h +++ b/include/fmt/format-inl.h @@ -682,8 +682,7 @@ template struct grisu_shortest_handler { } }; -template ::type> +template FMT_FUNC bool grisu_format(Double value, buffer& buf, int precision, unsigned options, int& exp) { FMT_ASSERT(value >= 0, "value is negative"); diff --git a/include/fmt/format.h b/include/fmt/format.h index 52caad57..0c462d13 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -2239,7 +2239,7 @@ FMT_CONSTEXPR bool do_check_format_string(basic_string_view s, } template ::value, int>::type> + FMT_ENABLE_IF_T(is_compile_string::value)> void check_format_string(S format_str) { typedef typename S::char_type char_t; FMT_CONSTEXPR_DECL bool invalid_format =