From 51d3685efe0eb8a44656f9fd5dac6a04f4e58259 Mon Sep 17 00:00:00 2001 From: Vladislav Shchapov Date: Sat, 15 Oct 2022 04:34:24 +0500 Subject: [PATCH] Remove duplicate template parameter. (#3142) Signed-off-by: Vladislav Shchapov Signed-off-by: Vladislav Shchapov --- include/fmt/chrono.h | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/include/fmt/chrono.h b/include/fmt/chrono.h index abfb900e0b81..1ed94ace3aa8 100644 --- a/include/fmt/chrono.h +++ b/include/fmt/chrono.h @@ -2061,17 +2061,15 @@ struct formatter, this->do_parse(default_specs.begin(), default_specs.end()); } - template - auto format(std::chrono::time_point> - val, + template + auto format(std::chrono::time_point val, FormatContext& ctx) const -> decltype(ctx.out()) { - if (Period::num != 1 || Period::den != 1 || - std::is_floating_point::value) { + using period = typename Duration::period; + if (period::num != 1 || period::den != 1 || + std::is_floating_point::value) { const auto epoch = val.time_since_epoch(); - const auto subsecs = - std::chrono::duration_cast>( - epoch - std::chrono::duration_cast(epoch)); + const auto subsecs = std::chrono::duration_cast( + epoch - std::chrono::duration_cast(epoch)); return formatter::format( localtime(std::chrono::time_point_cast(val)), @@ -2090,7 +2088,7 @@ struct formatter, Char> : formatter, Char> { - template + template auto format(std::chrono::time_point val, FormatContext& ctx) const -> decltype(ctx.out()) { return formatter<