diff options
Diffstat (limited to 'test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_and_explicit.pass.cpp')
-rw-r--r-- | test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_and_explicit.pass.cpp | 27 |
1 files changed, 7 insertions, 20 deletions
diff --git a/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_and_explicit.pass.cpp b/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_and_explicit.pass.cpp index d83bbf264de5..26ff5f65e7db 100644 --- a/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_and_explicit.pass.cpp +++ b/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_and_explicit.pass.cpp @@ -23,10 +23,11 @@ #include <type_traits> #include <cassert> +#include "atomic_helpers.h" + template <class T> -void -test() -{ +struct TestFn { + void operator()() const { { typedef std::atomic<T> A; A t; @@ -43,24 +44,10 @@ test() std::memory_order_seq_cst) == T(3)); assert(t == T(2)); } -} + } +}; int main() { - test<char>(); - test<signed char>(); - test<unsigned char>(); - test<short>(); - test<unsigned short>(); - test<int>(); - test<unsigned int>(); - test<long>(); - test<unsigned long>(); - test<long long>(); - test<unsigned long long>(); - test<wchar_t>(); -#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS - test<char16_t>(); - test<char32_t>(); -#endif // _LIBCPP_HAS_NO_UNICODE_CHARS + TestEachIntegralType<TestFn>()(); } |