tmp/tmpectieoaa/{from.md → to.md}
RENAMED
|
@@ -5,38 +5,40 @@ namespace std {
|
|
| 5 |
template<class T> struct atomic_ref {
|
| 6 |
private:
|
| 7 |
T* ptr; // exposition only
|
| 8 |
|
| 9 |
public:
|
| 10 |
-
using value_type = T;
|
| 11 |
static constexpr size_t required_alignment = implementation-defined // required alignment for atomic_ref type's operations;
|
| 12 |
|
| 13 |
static constexpr bool is_always_lock_free = implementation-defined // whether a given atomic_ref type's operations are always lock free;
|
| 14 |
bool is_lock_free() const noexcept;
|
| 15 |
|
| 16 |
-
explicit atomic_ref(T&);
|
| 17 |
-
atomic_ref(const atomic_ref&) noexcept;
|
| 18 |
atomic_ref& operator=(const atomic_ref&) = delete;
|
| 19 |
|
| 20 |
-
void store(
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
operator
|
| 24 |
|
| 25 |
-
|
| 26 |
-
|
|
|
|
| 27 |
memory_order, memory_order) const noexcept;
|
| 28 |
-
bool compare_exchange_strong(
|
| 29 |
memory_order, memory_order) const noexcept;
|
| 30 |
-
bool compare_exchange_weak(
|
| 31 |
memory_order = memory_order::seq_cst) const noexcept;
|
| 32 |
-
bool compare_exchange_strong(
|
| 33 |
memory_order = memory_order::seq_cst) const noexcept;
|
| 34 |
|
| 35 |
-
void wait(
|
| 36 |
-
void notify_one() const noexcept;
|
| 37 |
-
void notify_all() const noexcept;
|
|
|
|
| 38 |
};
|
| 39 |
}
|
| 40 |
```
|
| 41 |
|
| 42 |
An `atomic_ref` object applies atomic operations [[atomics.general]] to
|
|
@@ -61,5 +63,8 @@ through any other `atomic_ref` referencing the same object.
|
|
| 61 |
[*Note 1*: Atomic operations or the `atomic_ref` constructor can
|
| 62 |
acquire a shared resource, such as a lock associated with the referenced
|
| 63 |
object, to enable atomic operations to be applied to the referenced
|
| 64 |
object. — *end note*]
|
| 65 |
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
template<class T> struct atomic_ref {
|
| 6 |
private:
|
| 7 |
T* ptr; // exposition only
|
| 8 |
|
| 9 |
public:
|
| 10 |
+
using value_type = remove_cv_t<T>;
|
| 11 |
static constexpr size_t required_alignment = implementation-defined // required alignment for atomic_ref type's operations;
|
| 12 |
|
| 13 |
static constexpr bool is_always_lock_free = implementation-defined // whether a given atomic_ref type's operations are always lock free;
|
| 14 |
bool is_lock_free() const noexcept;
|
| 15 |
|
| 16 |
+
constexpr explicit atomic_ref(T&);
|
| 17 |
+
constexpr atomic_ref(const atomic_ref&) noexcept;
|
| 18 |
atomic_ref& operator=(const atomic_ref&) = delete;
|
| 19 |
|
| 20 |
+
constexpr void store(value_type, memory_order = memory_order::seq_cst) const noexcept;
|
| 21 |
+
constexpr value_type operator=(value_type) const noexcept;
|
| 22 |
+
constexpr value_type load(memory_order = memory_order::seq_cst) const noexcept;
|
| 23 |
+
constexpr operator value_type() const noexcept;
|
| 24 |
|
| 25 |
+
constexpr value_type exchange(value_type,
|
| 26 |
+
memory_order = memory_order::seq_cst) const noexcept;
|
| 27 |
+
constexpr bool compare_exchange_weak(value_type&, value_type,
|
| 28 |
memory_order, memory_order) const noexcept;
|
| 29 |
+
constexpr bool compare_exchange_strong(value_type&, value_type,
|
| 30 |
memory_order, memory_order) const noexcept;
|
| 31 |
+
constexpr bool compare_exchange_weak(value_type&, value_type,
|
| 32 |
memory_order = memory_order::seq_cst) const noexcept;
|
| 33 |
+
constexpr bool compare_exchange_strong(value_type&, value_type,
|
| 34 |
memory_order = memory_order::seq_cst) const noexcept;
|
| 35 |
|
| 36 |
+
constexpr void wait(value_type, memory_order = memory_order::seq_cst) const noexcept;
|
| 37 |
+
constexpr void notify_one() const noexcept;
|
| 38 |
+
constexpr void notify_all() const noexcept;
|
| 39 |
+
constexpr T* address() const noexcept;
|
| 40 |
};
|
| 41 |
}
|
| 42 |
```
|
| 43 |
|
| 44 |
An `atomic_ref` object applies atomic operations [[atomics.general]] to
|
|
|
|
| 63 |
[*Note 1*: Atomic operations or the `atomic_ref` constructor can
|
| 64 |
acquire a shared resource, such as a lock associated with the referenced
|
| 65 |
object, to enable atomic operations to be applied to the referenced
|
| 66 |
object. — *end note*]
|
| 67 |
|
| 68 |
+
The program is ill-formed if `is_always_lock_free` is `false` and
|
| 69 |
+
`is_volatile_v<T>` is `true`.
|
| 70 |
+
|