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

support C++23 character range formatting #3857

Closed
dvirtz opened this issue Feb 19, 2024 · 1 comment · Fixed by #3863
Closed

support C++23 character range formatting #3857

dvirtz opened this issue Feb 19, 2024 · 1 comment · Fixed by #3863

Comments

@dvirtz
Copy link

dvirtz commented Feb 19, 2024

In C++23 it's possible to use the s formatter to format char ranges as strings

Format String Contents Formatted Output
{:s} vector{'H', '\t', 'l', 'l', 'o'} H llo
{:?s} vector{'H', '\t', 'l', 'l', 'o'} "H\tllo"

p2286r8

Trying to do the same with libfmt results in an "invalid format specifier" error

https://flux.godbolt.org/z/nacKGTfM7

@vitaut
Copy link
Contributor

vitaut commented Feb 19, 2024

The s format specifier for ranges is not supported yet.

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

Successfully merging a pull request may close this issue.

2 participants