Add a definition for odr-used static constexpr member
This commit is contained in:
parent
65045a7975
commit
bc666b23eb
@ -458,8 +458,7 @@ struct formatter<std::chrono::time_point<std::chrono::system_clock, Duration>,
|
|||||||
auto end = it;
|
auto end = it;
|
||||||
while (end != ctx.end() && *end != '}') ++end;
|
while (end != ctx.end() && *end != '}') ++end;
|
||||||
if (end == it)
|
if (end == it)
|
||||||
this->specs = {default_spec,
|
this->specs = {default_spec, 17};
|
||||||
std::end(default_spec) - std::begin(default_spec)};
|
|
||||||
else
|
else
|
||||||
this->specs = {it, detail::to_unsigned(end - it)};
|
this->specs = {it, detail::to_unsigned(end - it)};
|
||||||
return end;
|
return end;
|
||||||
@ -472,11 +471,16 @@ struct formatter<std::chrono::time_point<std::chrono::system_clock, Duration>,
|
|||||||
return formatter<std::tm, Char>::format(time, ctx);
|
return formatter<std::tm, Char>::format(time, ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
static constexpr inline Char default_spec[] = {'%', 'Y', '-', '%', 'm', '-',
|
static constexpr Char default_spec[] = {'%', 'Y', '-', '%', 'm', '-',
|
||||||
'%', 'd', ' ', '%', 'H', ':',
|
'%', 'd', ' ', '%', 'H', ':',
|
||||||
'%', 'M', ':', '%', 'S'};
|
'%', 'M', ':', '%', 'S'};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
template <typename Char, typename Duration>
|
||||||
|
constexpr Char
|
||||||
|
formatter<std::chrono::time_point<std::chrono::system_clock, Duration>,
|
||||||
|
Char>::default_spec[];
|
||||||
|
|
||||||
template <typename Char> struct formatter<std::tm, Char> {
|
template <typename Char> struct formatter<std::tm, Char> {
|
||||||
template <typename ParseContext>
|
template <typename ParseContext>
|
||||||
FMT_CONSTEXPR auto parse(ParseContext& ctx) -> decltype(ctx.begin()) {
|
FMT_CONSTEXPR auto parse(ParseContext& ctx) -> decltype(ctx.begin()) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user