Add comment

Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
This commit is contained in:
Vladislav Shchapov 2022-07-30 11:47:33 +05:00 committed by Victor Zverovich
parent 36a25d75b4
commit 5a8b7cd742

View File

@ -2028,6 +2028,7 @@ template <typename Char> struct formatter<std::tm, Char> {
template <typename It> FMT_CONSTEXPR auto do_parse(It begin, It end) -> It { template <typename It> FMT_CONSTEXPR auto do_parse(It begin, It end) -> It {
if (begin != end && *begin == ':') ++begin; if (begin != end && *begin == ':') ++begin;
end = detail::parse_chrono_format(begin, end, detail::tm_format_checker()); end = detail::parse_chrono_format(begin, end, detail::tm_format_checker());
// Replace default spec only if the new spec is not empty.
if (end != begin) specs = {begin, detail::to_unsigned(end - begin)}; if (end != begin) specs = {begin, detail::to_unsigned(end - begin)};
// basic_string_view<>::compare isn't constexpr before C++17. // basic_string_view<>::compare isn't constexpr before C++17.
if (specs.size() == 2 && specs[0] == Char('%')) { if (specs.size() == 2 && specs[0] == Char('%')) {