[libcxx-commits] [libcxx] [libc++][atomic] P2835R7: Expose `std::atomic_ref`'s object address (PR #162236)

Nikolas Klauser via libcxx-commits libcxx-commits at lists.llvm.org
Tue Oct 7 03:26:08 PDT 2025


================
@@ -220,6 +220,9 @@ struct __atomic_ref_base {
   }
   _LIBCPP_HIDE_FROM_ABI void notify_one() const noexcept { std::__atomic_notify_one(*this); }
   _LIBCPP_HIDE_FROM_ABI void notify_all() const noexcept { std::__atomic_notify_all(*this); }
+#  if _LIBCPP_STD_VER >= 26
+  _LIBCPP_HIDE_FROM_ABI constexpr _Tp* address() const noexcept { return __ptr_; }
----------------
philnik777 wrote:

```suggestion
  [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Tp* address() const noexcept { return __ptr_; }
```
?

https://github.com/llvm/llvm-project/pull/162236


More information about the libcxx-commits mailing list