Skip to content

Possible enhancment: sequence delimiters #6

Description

@Bklyn

So now that std::pair is supported, it would be great to be able to have different delimiters at the start/end of sequences in addition to between the elements of a sequence, so a list of tuples might be rendered like:

(1, 2, 3), (3, 2, 1), ....

Otherwise there's no way to distinguish this:

list<int> ints ({1, 2, 3, 4, 5, 6})
cout << concat (separator (","), ints) << "\n";

from this:

list<pair<int, int>> pairs ({{1, 2}, {3, 4}, {5, 6});
cout << concat (separator (","), pairs) << "\n";

I think you're trying to keep things simple, so perhaps this is a feature too far.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions