[libcxx-commits] [libcxx] [libc++] Implement P0493R5: Atomic minimum/maximum (PR #180333)

Hristo Hristov via libcxx-commits libcxx-commits at lists.llvm.org
Sat Feb 7 09:23:25 PST 2026


================
@@ -799,6 +813,60 @@ atomic_fetch_xor_explicit(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __o
   return __o->fetch_xor(__op, __m);
 }
 
+#if _LIBCPP_STD_VER >= 26
+// atomic_fetch_max
+
+template <class _Tp, __enable_if_t<is_integral<_Tp>::value && !is_same<_Tp, bool>::value, int> = 0>
----------------
H-G-Hristov wrote:



These new functions are  C++26 only, right? You should use C++20 concepts instead: https://libcxx.llvm.org/CodingGuidelines.html#write-sfinae-with-requires-clauses-in-c-20-only-code

e.g. something like
```suggestion
template <class _Tp>
     requires (integral<_Tp> && !same_as<_Tp, bool>)
```

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


More information about the libcxx-commits mailing list