[libcxx-commits] [libcxx] [libcxx] Implementation of P1831R1 (PR #101439)
Josh Karns via libcxx-commits
libcxx-commits at lists.llvm.org
Sat Aug 3 14:45:19 PDT 2024
================
@@ -74,7 +74,7 @@ struct atomic<_Tp*> : public __atomic_base<_Tp*> {
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR atomic(_Tp* __d) _NOEXCEPT : __base(__d) {}
_LIBCPP_HIDE_FROM_ABI _Tp* operator=(_Tp* __d) volatile _NOEXCEPT
- requires __base::is_always_lock_free
+ _LIBCPP_REQUIRE_IS_ALWAYS_LOCK_FREE
----------------
jkarns275 wrote:
> I think the approach in [microsoft/STL#634](https://github.com/microsoft/STL/pull/634) works - define a conditionally deprecated but always `true` constant and then `static_assert` it. With this approach you don't need to be worried about whether some atomic types are always lock-free.
I am pursuing this right now, as it seems to be the only way to consistently raise deprecated warnings.
https://github.com/llvm/llvm-project/pull/101439
More information about the libcxx-commits
mailing list