-
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 built-in int128 when available #1287
Conversation
d3174be
to
3c76fc7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR! In general looks good, but I have a bunch of inline comments about the details.
e0155b1
to
502a163
Compare
Behavior of I suggest changing the existing functions' name to I noticed that Let me know your thoughts. |
502a163
to
cc5456c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure how you'd do that. The other block is inside the union.
Do you mean like this?
Nevermind, I forgot that you need to terminate the union which makes merging the ifdefs awkward. Let's keep as is.
Behavior of std::is_integral is different between libstdc++ with and without GNU extensions, and libc++. I do not want to add specializations to std namespace so I think it is appropriate to have a separate one in the fmt::internal namespace.
Makes sense.
I suggest changing the existing functions' name to is_integral_type and is_arithmetic_type to reserve the names of the standard type traits classes.
Sure. So internal::is_integral
will become internal::is_integral_type
and internal::is_integral_s
will become internal::is_integral
?
I noticed that std::is_integral is used in printf.h as well. I suppose at least some of those usages have to be replaced with fmt::internal::is_integral.
I don't think printf
supports int128_t
(at least not portably) so we don't need to change fmt's implementation either because it's mostly for migrating legacy code.
Okay, the warning is on Looks like |
One more thing: please add a test that checks if Line 1336 in a128b5b
|
cc5456c
to
94f0eb4
Compare
33bf8b1
to
0a3b7bc
Compare
To reserve space for the type traits sharing the same name as the ones from standard library.
0a3b7bc
to
66a228b
Compare
66a228b
to
d204837
Compare
d204837
to
ada263d
Compare
Merged, thanks! |
Thank you for reviewing and accepting the PR. |
I agree that my contributions are licensed under the {fmt} license, and agree to future changes to the licensing.
This is an initial implementation. I want to hear opinions before trying to extend it to other platforms and adding tests for it.