-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Closed
Description
Add support for printing ranges. Ideally:
std::initializer_list<int> a = {0, 2, 3, 4};
print("range: \"{r{}, }\"\n", a);
print("range: \"{r{}| }\"\n", a);
std::initializer_list<std::initializer_list<int>> a = { {0, 1}, {2, 3}, {4}};
print("range: \"{r{r{}, }| }\"\n", a);would print
range "0, 2, 3, 4"
range "0 | 2 | 3 | 4"
range "0, 1 | 2, 3 | 4"This would require a new format specifier, e.g. r, followed by a format specifier for the range element and a separator string: r{}sep. Note that r{r{}sep0}sep1 allows dealing with ranges of ranges.
A definition of Range, e.g., anything that can be called with non-member begin and end.
Metadata
Metadata
Assignees
Labels
No labels