diff --git a/include/fmt/chrono.h b/include/fmt/chrono.h index 02896741..0506a104 100644 --- a/include/fmt/chrono.h +++ b/include/fmt/chrono.h @@ -458,8 +458,7 @@ struct formatter, auto end = it; while (end != ctx.end() && *end != '}') ++end; if (end == it) - this->specs = {default_spec, - std::end(default_spec) - std::begin(default_spec)}; + this->specs = {default_spec, 17}; else this->specs = {it, detail::to_unsigned(end - it)}; return end; @@ -472,11 +471,16 @@ struct formatter, return formatter::format(time, ctx); } - static constexpr inline Char default_spec[] = {'%', 'Y', '-', '%', 'm', '-', - '%', 'd', ' ', '%', 'H', ':', - '%', 'M', ':', '%', 'S'}; + static constexpr Char default_spec[] = {'%', 'Y', '-', '%', 'm', '-', + '%', 'd', ' ', '%', 'H', ':', + '%', 'M', ':', '%', 'S'}; }; +template +constexpr Char + formatter, + Char>::default_spec[]; + template struct formatter { template FMT_CONSTEXPR auto parse(ParseContext& ctx) -> decltype(ctx.begin()) {