-
Notifications
You must be signed in to change notification settings - Fork 1.6k
enable std::assume_aligned #1306
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
Conversation
32f607a to
ad1a0aa
Compare
StephanTLavavej
left a comment
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 implementing this feature (over 4% of the remaining features 😹)! I think it'll be ready to merge after one round of revisions.
f1f2363 to
c5a09db
Compare
StephanTLavavej
left a comment
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.
This looks good, thanks! I pushed a couple of changes to the product code:
- Because Clang works, we should use
#ifndef __clang__to guard the workaround, so it activates for MSVC and EDG only. - We can "extract" the non-workaround code, so it doesn't have to be repeated.
I also changed the #endif comment, to make it super clear that the whole block is the workaround that should be removed. (Sometimes when a workaround is necessary for years, it's easy to forget what we should do when the relevant bug is finally fixed.)
I'll push one more change to the test code, then I think this will be ready for final review!
|
One more thing that I forgot to mention - squashing your development history down to a single commit before creating a PR (as you did here) is great. (Creating a PR with separate commits can make sense for mostly-unrelated changes or multi-layered rewrites; I do that occasionally.) However, after a PR has been created, further changes should generally be pushed without rewriting history. This is because GitHub's interface makes it relatively easy to see "commits added since my last review", but makes it very hard to see what happened between force-pushes. Totally not a problem for this PR, just advice for larger PRs in the future. 😺 |
`assume_aligned` never modifies its parameter.
StephanTLavavej
left a comment
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! I pushed a small change to restore the comment explaining how the Standard's power-of-two requirement is being enforced.
|
Thanks for aligning the STL's feature set with the C++20 Standard, and congratulations on implementing your first feature! 🎉 🚀 😺 |
Resolves #47
docs: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1007r3.pdf