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

ranges formatting doesn't work with format_to #1064

Closed
lethe555 opened this issue Mar 4, 2019 · 1 comment
Closed

ranges formatting doesn't work with format_to #1064

lethe555 opened this issue Mar 4, 2019 · 1 comment

Comments

@lethe555
Copy link

lethe555 commented Mar 4, 2019

char buf[100];
	auto p = fmt::format_to(buf, "{}", std::vector<int> { 1, 2, 3 });
	*p = 0;
	std::cout << buf << "\n"; // output nothing
	p = fmt::format_to(buf, "{}", 1);
	*p = 0;
    std::cout << buf << "\n"; // output "1"

seems formatter<RangeT,Char>::format hasn't updated iterator out
out= format_to(out,...);

@vitaut
Copy link
Contributor

vitaut commented Mar 6, 2019

Fixed in 2e526a6. Thanks for reporting.

@vitaut vitaut closed this as completed Mar 6, 2019
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