[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
================
@@ -0,0 +1,57 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// REQUIRES: std-at-least-c++26
+// XFAIL: !has-64-bit-atomics
+
+// <atomic>
+
+// template<class T>
+// T
+// atomic_fetch_max_explicit(volatile atomic<T>*, atomic<T>::value_type,
+// memory_order) noexcept;
+//
+// template<class T>
+// T
+// atomic_fetch_max_explicit(atomic<T>*, atomic<T>::value_type,
+// memory_order) noexcept;
+
+#include <atomic>
+#include <type_traits>
+#include <cassert>
+
+#include "test_macros.h"
+#include "atomic_helpers.h"
+
+template <class T>
+struct TestFn {
+ void operator()() const {
+ {
+ typedef std::atomic<T> A;
----------------
H-G-Hristov wrote:
```suggestion
using A = std::atomic<T>;
```
Don't use `typedef` you don't have to. Is this alias even necessary? It's used just one AFAIT.
https://github.com/llvm/llvm-project/pull/180333
More information about the libcxx-commits
mailing list