@@ -120,12 +120,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
template<typename _IntTp>
struct __atomic_base;
- /// atomic_char
- typedef __atomic_base<char> atomic_char;
-
- /// atomic_schar
- typedef __atomic_base<signed char> atomic_schar;
-
/// atomic_uchar
typedef __atomic_base<unsigned char> atomic_uchar;
@@ -49,21 +49,25 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
* @{
*/
- /// atomic_bool
+ template<typename _Tp>
+ struct atomic;
+
+ /// atomic<bool>
// NB: No operators or fetch-operations for this type.
- struct atomic_bool
+ template<>
+ struct atomic<bool>
{
private:
__atomic_base<bool> _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<bool> atomic_bool;
+
/**
* @brief Generic atomic type, primary class template.
@@ -485,31 +492,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
};
- /// Explicit specialization for bool.
- template<>
- struct atomic<bool> : 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<char> : public atomic_char
+ struct atomic<char> : public __atomic_base<char>
{
typedef char __integral_type;
- typedef atomic_char __base_type;
+ typedef __atomic_base<char> __base_type;
atomic() noexcept = default;
~atomic() noexcept = default;
@@ -523,12 +511,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
using __base_type::operator=;
};
+ /// atomic_char
+ typedef atomic<char> atomic_char;
+
/// Explicit specialization for signed char.
template<>
- struct atomic<signed char> : public atomic_schar
+ struct atomic<signed char> : public __atomic_base<signed char>
{
typedef signed char __integral_type;
- typedef atomic_schar __base_type;
+ typedef __atomic_base<signed char> __base_type;
atomic() noexcept= default;
~atomic() noexcept = default;
@@ -542,6 +533,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
using __base_type::operator=;
};
+ /// atomic_schar
+ typedef atomic<signed char> atomic_schar;
+
/// Explicit specialization for unsigned char.
template<>
struct atomic<unsigned char> : public atomic_uchar