Optimize %T in tm formatting - #2500
Merged
Merged
Conversation
phprus
force-pushed
the
optimize-tm-formatting-1
branch
from
September 13, 2021 07:59
6c6239d to
a9113e5
Compare
miscco
reviewed
Sep 13, 2021
| auto size = detail::to_unsigned(end - it); | ||
| specs = {it, size}; | ||
| if (specs == string_view("%F", 2)) spec_ = spec::year_month_day; | ||
| // basic_string_view<>::compare isn't constexpr before C++17 |
There was a problem hiding this comment.
There is no basic_string_view<> before C++17.
Could it be that the internal replacement should be updated?
Contributor
Author
There was a problem hiding this comment.
Problem in std::char_traits<>::compare:
Lines 472 to 478 in 3d0c7ae
constexpr std::char_traits<>::compare starts from C++17 only
vitaut
reviewed
Sep 15, 2021
| }; | ||
|
|
||
| class year_month_day {}; | ||
| class hh_mm_ss {}; |
phprus
force-pushed
the
optimize-tm-formatting-1
branch
from
September 15, 2021 14:25
a9113e5 to
7407f76
Compare
Contributor
I'm not sure if we should add more special cases but it would be nice to get rid of |
This was referenced Oct 9, 2021
Closed
phprus
added a commit
to phprus/fmt
that referenced
this pull request
Aug 22, 2022
… шаблон литерального оператора должен иметь список параметров шаблона, эквивалентный "<char ...>"
template <detail_exported::fixed_string Str> constexpr auto operator""_a() {
^
Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Optimization
%Tin tm formatting like this: 67cb2daAnd fix wchar_t tm formatting error:
Maybe I should add the use of
write_digit2_separatedfor formats:%Y-%m-%d%H:%M:%S%Y-%m-%d %H:%M:%S%Y-%m-%dT%H:%M:%S?