[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
Wed Jan 1 06:57:08 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:
It would be better to test constraints on other modifying operations.
https://github.com/llvm/llvm-project/pull/121414
More information about the libcxx-commits
mailing list