Avoid std::back_insert_iterator of fmt::memory_buffer in fmt::format#397
Merged
oleksandr-pavlyk merged 1 commit intoJun 30, 2026
Merged
Conversation
…::format fmt 12.2 changed the implementation path used by `fmt::format_to` with `std::back_insert_iterator`. Under nvcc, that path rejects `std::back_insert_iterator<fmt::memory_buffer>` because fmt’s constexpr helper takes a non-literal iterator type. Replacing `std::back_inserter(buffer)` with `fmt::appender(buffer)` for `fmt::memory_buffer` outputs avoids that path and is the fmt-native way to append to `memory_buffer`.
Collaborator
Author
|
@coderabbitai full review |
This comment was marked as outdated.
This comment was marked as outdated.
|
Caution Review failedAn error occurred during the review process. Please try again later. 📝 WalkthroughSummary by CodeRabbit
WalkthroughAll fmt::appender migration
Assessment against linked issues
Comment |
Collaborator
Author
|
The CI run using fmt 11.2 is green. I also opened #398 where version of fmt was bumped to 12.2 and also includes this change. That build is green as well. |
alliepiper
approved these changes
Jun 30, 2026
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.
closes #396
fmt 12.2 changed the implementation path used by
fmt::format_towithstd::back_insert_iterator. Under nvcc, that path rejectsstd::back_insert_iterator<fmt::memory_buffer>because fmt’s constexpr helper takes a non-literal iterator type. Replacingstd::back_inserter(buffer)withfmt::appender(buffer)forfmt::memory_bufferoutputs avoids that path and is the fmt-native way to append tomemory_buffer.