diff --git a/libstdc++-v3/include/bits/atomic_base.h b/libstdc++-v3/include/bits/atomic_base.h index 1fc0ebb..a591c46 100644 --- a/libstdc++-v3/include/bits/atomic_base.h +++ b/libstdc++-v3/include/bits/atomic_base.h @@ -120,12 +120,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION template struct __atomic_base; - /// atomic_char - typedef __atomic_base atomic_char; - - /// atomic_schar - typedef __atomic_base atomic_schar; - /// atomic_uchar typedef __atomic_base atomic_uchar; diff --git a/libstdc++-v3/include/std/atomic b/libstdc++-v3/include/std/atomic index 85dc252..c58853e 100644 --- a/libstdc++-v3/include/std/atomic +++ b/libstdc++-v3/include/std/atomic @@ -49,21 +49,25 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION * @{ */ - /// atomic_bool + template + struct atomic; + + /// atomic // NB: No operators or fetch-operations for this type. - struct atomic_bool + template<> + struct atomic { private: __atomic_base _M_base; public: - atomic_bool() noexcept = default; - ~atomic_bool() noexcept = default; - atomic_bool(const atomic_bool&) = delete; - atomic_bool& operator=(const atomic_bool&) = delete; - atomic_bool& operator=(const atomic_bool&) volatile = delete; + atomic() noexcept = default; + ~atomic() noexcept = default; + atomic(const atomic&) = delete; + atomic& operator=(const atomic&) = delete; + atomic& operator=(const atomic&) volatile = delete; - constexpr atomic_bool(bool __i) noexcept : _M_base(__i) { } + constexpr atomic(bool __i) noexcept : _M_base(__i) { } bool operator=(bool __i) noexcept @@ -151,6 +155,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { return _M_base.compare_exchange_strong(__i1, __i2, __m); } }; + /// atomic_bool + typedef atomic atomic_bool; + /** * @brief Generic atomic type, primary class template. @@ -485,31 +492,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION }; - /// Explicit specialization for bool. - template<> - struct atomic : public atomic_bool - { - typedef bool __integral_type; - typedef atomic_bool __base_type; - - atomic() noexcept = default; - ~atomic() noexcept = default; - atomic(const atomic&) = delete; - atomic& operator=(const atomic&) = delete; - atomic& operator=(const atomic&) volatile = delete; - - constexpr atomic(__integral_type __i) noexcept : __base_type(__i) { } - - using __base_type::operator __integral_type; - using __base_type::operator=; - }; - /// Explicit specialization for char. template<> - struct atomic : public atomic_char + struct atomic : public __atomic_base { typedef char __integral_type; - typedef atomic_char __base_type; + typedef __atomic_base __base_type; atomic() noexcept = default; ~atomic() noexcept = default; @@ -523,12 +511,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION using __base_type::operator=; }; + /// atomic_char + typedef atomic atomic_char; + /// Explicit specialization for signed char. template<> - struct atomic : public atomic_schar + struct atomic : public __atomic_base { typedef signed char __integral_type; - typedef atomic_schar __base_type; + typedef __atomic_base __base_type; atomic() noexcept= default; ~atomic() noexcept = default; @@ -542,6 +533,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION using __base_type::operator=; }; + /// atomic_schar + typedef atomic atomic_schar; + /// Explicit specialization for unsigned char. template<> struct atomic : public atomic_uchar