Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

join doesn't work with nested replacement fields #638

Closed
peterbell10 opened this issue Jan 17, 2018 · 1 comment
Closed

join doesn't work with nested replacement fields #638

peterbell10 opened this issue Jan 17, 2018 · 1 comment

Comments

@peterbell10
Copy link
Contributor

Running the following results in FormatError("unmatched '}' in format string") being thrown.

float test[10]{};
fmt::format("{0:.{1}f}", fmt::join(std::begin(test), std::end(test), ", "), 2);

This happens because ArgJoin's format_arg only advances the format string past the first '}' leaving "f}" to be formatted.

fmt/fmt/format.h

Lines 4116 to 4117 in c719d94

while (*end && *end != '}')
++end;

vitaut added a commit that referenced this issue Jan 20, 2018
@vitaut
Copy link
Contributor

vitaut commented Jan 20, 2018

Good catch, thanks! Fixed in 6822466.

@vitaut vitaut closed this as completed Jan 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants