[libcxx-commits] [libcxx] [libc++] std::atomic primary template should not have a `difference_type` member type (PR #123236)

Damien L-G via libcxx-commits libcxx-commits at lists.llvm.org
Mon Jan 20 12:50:24 PST 2025


================
@@ -29,163 +29,176 @@
 #  include <thread>
 #endif
 
-template <class A, bool Integral>
-struct test_atomic
-{
-    test_atomic()
-    {
-        A a; (void)a;
+// detect existence of the difference_type member type
+template <class...>
+using myvoid_t = void;
+template <typename T, typename = void>
+struct has_difference_type : std::false_type {};
+template <typename T>
+struct has_difference_type<T, myvoid_t<typename T::difference_type> > : std::true_type {};
+
+template <class A, bool IntegralOrFloating, bool Pointer>
----------------
dalg24 wrote:

Totally agree with you, was refraining to change things in that test.
Will apply once I get to a place with clang-format available.

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


More information about the libcxx-commits mailing list