-
Couldn't load subscription status.
- Fork 15k
[libc++][atomic] P2835R7: Expose std::atomic_ref's object address
#162236
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
[libc++][atomic] P2835R7: Expose std::atomic_ref's object address
#162236
Conversation
|
✅ With the latest revision this PR passed the C/C++ code formatter. |
|
|
||
| assert(a.address() == std::addressof(x)); | ||
|
|
||
| static_assert(noexcept((a.address()))); |
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.
constexpr on address doesn't seem tested. I think it's better to reorganize TestAddress to test constexpr together.
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.
It's weird that we haven't added constexpr to the constructor. Perhaps test for constexpr should be done in another PR...
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.
I think it makes sense to complete it after #118382 (P3309R3: constexpr atomic and atomic_ref)
ef90971 to
037a1cb
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.
LGTM
|
Thanks |
…lvm#162236) Implements https://wg21.link/P2835R7 Closes llvm#118377 # References - https://wg21.link/atomics.ref.generic.general - https://wg21.link/atomics.ref.int - https://wg21.link/atomics.ref.float - https://wg21.link/atomics.ref.pointer --------- Co-authored-by: Hristo Hristov <zingam@outlook.com>
Implements https://wg21.link/P2835R7
Closes #118377
References