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

Please provide fmt::printf which writes to BasicArrayWriter #476

Closed
sirzooro opened this issue Feb 24, 2017 · 2 comments
Closed

Please provide fmt::printf which writes to BasicArrayWriter #476

sirzooro opened this issue Feb 24, 2017 · 2 comments

Comments

@sirzooro
Copy link

I would like to replace snprintf calls in my app with your lib. For performance reasons I do not want to use fmt::sprintf and then copy created string to its destination. Better approach would be to wrap memory buffer with BasicArrayWriter and write there. However at this moment fmt lib does not provide appropriate API for this. Please add it.

@vitaut
Copy link
Contributor

vitaut commented Feb 26, 2017

Done in 6f8006c.

Now this should work:

fmt::MemoryWriter writer;
printf(writer, "%d", 42);

@vitaut vitaut closed this as completed Feb 26, 2017
@sirzooro
Copy link
Author

Thanks! I will give it a try tomorrow.

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