-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Add support for __float128
or std::float128_t
#3494
Comments
It is neither a bug nor you are doing anything wrong. {fmt} simply doesn't support formatting of |
__float128
or std::float128_t
__float128
or std::float128_t
I can see that, but how come it also doesn't allow creating a user-defined formatter? Not having a formatter is a missing feature; making it impossible to create one is a bug. |
You shouldn't be creating formatters for types you don't own and in this case it is intentionally impossible. You can create a formatter for a wrapper type though. |
Can you explain , what do you want in output ?? With a simple example , so that I can try to figure out . @Eisenwave |
It should have the same formatting option as floating-point numbers of lower precision. |
|
@vitaut can you please explain this statement some more? There's guidance elsewhere suggesting people write custom formatters for |
If you define a formatter for a third-party type you run into a risk of conflicts with someone doing the same. It is particularly bad for standard types since the newer version of the standard can add its own formatter causing breakages. So that guidance is wrong and I recommend ignoring it or better asking the authors to change/remove it. |
Okay so I guess |
To clarify: {fmt} doesn't use standard formatters but both the standard library and {fmt} can provide formatters for standard library and built-in types which will have similar effect. |
Sorry I'm still not able to grasp what the issue with this is or how "the newer version of the standard can add its own formatter causing breakages". If fmt lib doesn't use standard formatters, how would these breakages occur? If I write a |
If you do it in your own private project then it's less of a problem as you are the only one who will suffer because of the breakage. |
fmt 9 added support for
fmt::to_string(__float128)
but no formatter yet as far as I know. I've tried to make my own like below, but this failed:Am I doing something wrong or is this a bug?
The error is very long, so I won't post all of it here. See https://godbolt.org/z/9GPM5MGvG for full output.
The text was updated successfully, but these errors were encountered: