Repository navigation
Conversation
Added ranges-formatting FMT_COMPILE tests were not working previously. This is because of a discrepancy between compile.h and format.h, former was using `std::back_inserter(std::string)`, while latter was using `back_appender(basic_memory_buffer)`.
vitaut
requested changes
Oct 18, 2026
Comment on lines
+482
to
+484
| auto buf = basic_memory_buffer<Char>(); | ||
| cf.format(basic_appender<Char>(buf), args...); | ||
| return std::basic_string<Char>(buf.data(), buf.size()); |
Contributor
There was a problem hiding this comment.
This may regress perf for common cases by introducing a copy.
Contributor
Author
There was a problem hiding this comment.
I would argue there is no perf regression as the current state does not compile, so notion of performance falls apart. But I agree it is not optimal, such a fix seems slightly more involved though.
Contributor
There was a problem hiding this comment.
The regression affects existing use cases that compile and work today, not just the newly supported range formatting.
Contributor
Author
There was a problem hiding this comment.
I just rebased locally, killed my compile.h change, and tested compile_test. Builds and passes. Seems the issue has been fixed already, so closing this PR as unnecessary.
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.
Added ranges-formatting FMT_COMPILE tests were not working previously. This is because of a discrepancy between compile.h and format.h, former was using
std::back_inserter(std::string), while latter was usingback_appender(basic_memory_buffer).This is actually needed because a different part has a bug:
The snippet tries to construct a
FormatContextusing a different iterator type.It didn't seem obvious how to fix it, as
ctx.args()is also context specific.This PR is a cleanup of #4956