Draft: Add support for specifying the separator for range types #4090
+48
−20
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.
This is a draft because I want to get some early feedback on whether this is something we want, and if I'm going about it the right way.
This adds support for the
m
andn
specifiers for ranges and tuples, as described in the cppreference page forstd::formatter<pair-or-tuple>
and a new,
specifier (feedback on the character to use is welcome), such that the separator for elements becomes the string after the specifier.This partly reverts 16cec4f, but I may be missing the point of that commit, as all tests pass before that commit, including the test introduced in that commit, if the
struct formatter<std::pair<K, test_map_value>>
specialization is removed. I do not understand the point of that part of the test, as the test doesn't use thatformatter
. @vitaut Could you explain that?