[libcxx-commits] [libcxx] [libc++] cv-qualified types in atomic and atomic_ref (P3323R1) (PR #121414)

A. Jiang via libcxx-commits libcxx-commits at lists.llvm.org
Thu Jan 2 05:55:41 PST 2025


================
@@ -19,27 +19,49 @@
 #include "test_helper.h"
 #include "test_macros.h"
 
-template <typename T>
+template <typename T, typename U>
+concept has_store = requires { std::declval<T>().store(std::declval<U>()); };
+
+template <typename U>
 struct TestStore {
   void operator()() const {
+    static_assert(has_store<std::atomic_ref<U>, U>);
+    do_test<U>();
+    do_test_atomic<U>();
+    static_assert(!has_store<std::atomic_ref<U const>, U>);
----------------
frederick-vs-ja wrote:

I meant testing other `static_assert(!has_meow<std::atomic_ref<U const>>>)` , where each `has_meow` detects one of `compare_exchange_weak`, `fetch_add`, etc..

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


More information about the libcxx-commits mailing list