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

format_to for basic_memory_writer #776

Closed
scamille opened this issue Jun 9, 2018 · 1 comment
Closed

format_to for basic_memory_writer #776

scamille opened this issue Jun 9, 2018 · 1 comment

Comments

@scamille
Copy link

scamille commented Jun 9, 2018

I tried to port my existing ArrayWriter code to the new fmt::basic_memory_writer in Release 5.0.0.

Example which does not work:

fmt::basic_memory_buffer<char, 100> buffer;
fmt::format_to(buffer, "{}", "foo");

What does work:

fmt::memory_buffer buffer;
fmt::format_to(buffer, "{}", "foo");

Would it be possible to provide a fmt::format_to overload which accepts all fmt::basic_memory_writer's, and not just the particular fmt::memory_writer typedef?

Thanks for all the hard work. We are using the library successfully in a medium sized open source project, both as a modern formatting library, as well as a replacement for legacy printf code.

@vitaut
Copy link
Contributor

vitaut commented Jun 23, 2018

Would it be possible to provide a fmt::format_to overload which accepts all fmt::basic_memory_writer's, and not just the particular fmt::memory_writer typedef?

Yes, done in ab2d88c.

Thanks for all the hard work. We are using the library successfully in a medium sized open source project, both as a modern formatting library, as well as a replacement for legacy printf code.

Thanks! Glad that it works for you.

@vitaut vitaut closed this as completed Jun 23, 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