-
Notifications
You must be signed in to change notification settings - Fork 1.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
<numeric> Optimize gcd to use builtins #665
Conversation
Test failures look legit on this one :) |
Hm I compiled for me, I will check again :( |
Go home test you are drunk:
So it seems that common_unsigned does funny things |
The full error is:
So in the test the type is So the type passed to |
It seems that for whatever reason the template argument deduction fails. if I specify That however smells terribly like a compiler bug |
So tests are good, although I would like an opinion whether this is a compiler bug or just me not understanding C++. The only thing I could com up with is that |
Why not? https://eel.is/c++draft/expr.unary.op#10
https://eel.is/c++draft/conv.prom#2
("Can" here means the conversion exists as integral promotion. The key verb here is "are" above. Promotions are performed) |
Fix tpyo
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.
Looks great, thank you! I tried my hardest, but the only issue I could find was a whitespace nitpick.
Co-Authored-By: Stephan T. Lavavej <stl@nuwen.net>
Thanks for the performance enhancement! 🐎 |
Description
This fixes #298 by moving the meat of the bitscan implementation to the limits header.
This seems unfortunate but is the smallest common denominator of
<numeric>
and<bit>
Also we cannot go without limits anyway because the implementation needs it.
Checklist
Be sure you've read README.md and understand the scope of this repo.
If you're unsure about a box, leave it unchecked. A maintainer will help you.
_Ugly
as perhttps://eel.is/c++draft/lex.name#3.1 or there are no product code changes.
verified by an STL maintainer before automated testing is enabled on GitHub,
leave this unchecked for initial submission).
members, adding virtual functions, changing whether a type is an aggregate
or trivially copyable, etc.).
the C++ Working Draft (including any cited standards), other WG21 papers
(excluding reference implementations outside of proposed standard wording),
and LWG issues as reference material. If they were derived from a project
that's already listed in NOTICE.txt, that's fine, but please mention it.
If they were derived from any other project (including Boost and libc++,
which are not yet listed in NOTICE.txt), you must mention it here,
so we can determine whether the license is compatible and what else needs
to be done.