tmp/tmpcc0oq5s9/{from.md → to.md}
RENAMED
|
@@ -50,11 +50,11 @@ template<class T>
|
|
| 50 |
void atomic_store(shared_ptr<T>* p, shared_ptr<T> r);
|
| 51 |
```
|
| 52 |
|
| 53 |
*Requires:* `p` shall not be null.
|
| 54 |
|
| 55 |
-
*Effects:* `atomic_store_explicit(p, r, memory_order_seq_cst)`.
|
| 56 |
|
| 57 |
*Throws:* Nothing.
|
| 58 |
|
| 59 |
``` cpp
|
| 60 |
template<class T>
|
|
@@ -64,11 +64,11 @@ template<class T>
|
|
| 64 |
*Requires:* `p` shall not be null.
|
| 65 |
|
| 66 |
*Requires:* `mo` shall not be `memory_order_acquire` or
|
| 67 |
`memory_order_acq_rel`.
|
| 68 |
|
| 69 |
-
*Effects:* `p->swap(r)`.
|
| 70 |
|
| 71 |
*Throws:* Nothing.
|
| 72 |
|
| 73 |
``` cpp
|
| 74 |
template<class T>
|
|
@@ -81,43 +81,46 @@ template<class T>
|
|
| 81 |
|
| 82 |
*Throws:* Nothing.
|
| 83 |
|
| 84 |
``` cpp
|
| 85 |
template<class T>
|
| 86 |
-
shared_ptr<T> atomic_exchange_explicit(shared_ptr<T>* p, shared_ptr<T> r,
|
| 87 |
-
memory_order mo);
|
| 88 |
```
|
| 89 |
|
| 90 |
*Requires:* `p` shall not be null.
|
| 91 |
|
| 92 |
-
*Effects:* `p->swap(r)`.
|
| 93 |
|
| 94 |
*Returns:* The previous value of `*p`.
|
| 95 |
|
| 96 |
*Throws:* Nothing.
|
| 97 |
|
| 98 |
``` cpp
|
| 99 |
template<class T>
|
| 100 |
-
bool atomic_compare_exchange_weak(
|
| 101 |
-
shared_ptr<T>* p, shared_ptr<T>* v, shared_ptr<T> w);
|
| 102 |
```
|
| 103 |
|
| 104 |
*Requires:* `p` shall not be null and `v` shall not be null.
|
| 105 |
|
| 106 |
*Returns:*
|
| 107 |
-
|
|
|
|
|
|
|
|
|
|
| 108 |
|
| 109 |
*Throws:* Nothing.
|
| 110 |
|
| 111 |
``` cpp
|
| 112 |
template<class T>
|
| 113 |
-
bool atomic_compare_exchange_strong(
|
| 114 |
-
shared_ptr<T>* p, shared_ptr<T>* v, shared_ptr<T> w);
|
| 115 |
```
|
| 116 |
|
| 117 |
-
*Returns:*
|
| 118 |
-
|
|
|
|
|
|
|
|
|
|
| 119 |
|
| 120 |
``` cpp
|
| 121 |
template<class T>
|
| 122 |
bool atomic_compare_exchange_weak_explicit(
|
| 123 |
shared_ptr<T>* p, shared_ptr<T>* v, shared_ptr<T> w,
|
|
@@ -126,25 +129,22 @@ template<class T>
|
|
| 126 |
bool atomic_compare_exchange_strong_explicit(
|
| 127 |
shared_ptr<T>* p, shared_ptr<T>* v, shared_ptr<T> w,
|
| 128 |
memory_order success, memory_order failure);
|
| 129 |
```
|
| 130 |
|
| 131 |
-
*Requires:* `p` shall not be null and `v` shall not be null.
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
`memory_order_acq_rel`, or stronger than `success`.
|
| 135 |
|
| 136 |
*Effects:* If `*p` is equivalent to `*v`, assigns `w` to `*p` and has
|
| 137 |
synchronization semantics corresponding to the value of `success`,
|
| 138 |
otherwise assigns `*p` to `*v` and has synchronization semantics
|
| 139 |
corresponding to the value of `failure`.
|
| 140 |
|
| 141 |
*Returns:* `true` if `*p` was equivalent to `*v`, `false` otherwise.
|
| 142 |
|
| 143 |
*Throws:* Nothing.
|
| 144 |
|
| 145 |
-
*Remarks:*
|
| 146 |
-
same pointer value and share ownership.
|
| 147 |
-
|
| 148 |
-
*Remarks:* the weak forms may fail spuriously.
|
| 149 |
-
See [[atomics.types.operations]].
|
| 150 |
|
|
|
|
| 50 |
void atomic_store(shared_ptr<T>* p, shared_ptr<T> r);
|
| 51 |
```
|
| 52 |
|
| 53 |
*Requires:* `p` shall not be null.
|
| 54 |
|
| 55 |
+
*Effects:* As if by `atomic_store_explicit(p, r, memory_order_seq_cst)`.
|
| 56 |
|
| 57 |
*Throws:* Nothing.
|
| 58 |
|
| 59 |
``` cpp
|
| 60 |
template<class T>
|
|
|
|
| 64 |
*Requires:* `p` shall not be null.
|
| 65 |
|
| 66 |
*Requires:* `mo` shall not be `memory_order_acquire` or
|
| 67 |
`memory_order_acq_rel`.
|
| 68 |
|
| 69 |
+
*Effects:* As if by `p->swap(r)`.
|
| 70 |
|
| 71 |
*Throws:* Nothing.
|
| 72 |
|
| 73 |
``` cpp
|
| 74 |
template<class T>
|
|
|
|
| 81 |
|
| 82 |
*Throws:* Nothing.
|
| 83 |
|
| 84 |
``` cpp
|
| 85 |
template<class T>
|
| 86 |
+
shared_ptr<T> atomic_exchange_explicit(shared_ptr<T>* p, shared_ptr<T> r, memory_order mo);
|
|
|
|
| 87 |
```
|
| 88 |
|
| 89 |
*Requires:* `p` shall not be null.
|
| 90 |
|
| 91 |
+
*Effects:* As if by `p->swap(r)`.
|
| 92 |
|
| 93 |
*Returns:* The previous value of `*p`.
|
| 94 |
|
| 95 |
*Throws:* Nothing.
|
| 96 |
|
| 97 |
``` cpp
|
| 98 |
template<class T>
|
| 99 |
+
bool atomic_compare_exchange_weak(shared_ptr<T>* p, shared_ptr<T>* v, shared_ptr<T> w);
|
|
|
|
| 100 |
```
|
| 101 |
|
| 102 |
*Requires:* `p` shall not be null and `v` shall not be null.
|
| 103 |
|
| 104 |
*Returns:*
|
| 105 |
+
|
| 106 |
+
``` cpp
|
| 107 |
+
atomic_compare_exchange_weak_explicit(p, v, w, memory_order_seq_cst, memory_order_seq_cst)
|
| 108 |
+
```
|
| 109 |
|
| 110 |
*Throws:* Nothing.
|
| 111 |
|
| 112 |
``` cpp
|
| 113 |
template<class T>
|
| 114 |
+
bool atomic_compare_exchange_strong(shared_ptr<T>* p, shared_ptr<T>* v, shared_ptr<T> w);
|
|
|
|
| 115 |
```
|
| 116 |
|
| 117 |
+
*Returns:*
|
| 118 |
+
|
| 119 |
+
``` cpp
|
| 120 |
+
atomic_compare_exchange_strong_explicit(p, v, w, memory_order_seq_cst, memory_order_seq_cst)
|
| 121 |
+
```
|
| 122 |
|
| 123 |
``` cpp
|
| 124 |
template<class T>
|
| 125 |
bool atomic_compare_exchange_weak_explicit(
|
| 126 |
shared_ptr<T>* p, shared_ptr<T>* v, shared_ptr<T> w,
|
|
|
|
| 129 |
bool atomic_compare_exchange_strong_explicit(
|
| 130 |
shared_ptr<T>* p, shared_ptr<T>* v, shared_ptr<T> w,
|
| 131 |
memory_order success, memory_order failure);
|
| 132 |
```
|
| 133 |
|
| 134 |
+
*Requires:* `p` shall not be null and `v` shall not be null. The
|
| 135 |
+
`failure` argument shall not be `memory_order_release` nor
|
| 136 |
+
`memory_order_acq_rel`.
|
|
|
|
| 137 |
|
| 138 |
*Effects:* If `*p` is equivalent to `*v`, assigns `w` to `*p` and has
|
| 139 |
synchronization semantics corresponding to the value of `success`,
|
| 140 |
otherwise assigns `*p` to `*v` and has synchronization semantics
|
| 141 |
corresponding to the value of `failure`.
|
| 142 |
|
| 143 |
*Returns:* `true` if `*p` was equivalent to `*v`, `false` otherwise.
|
| 144 |
|
| 145 |
*Throws:* Nothing.
|
| 146 |
|
| 147 |
+
*Remarks:* Two `shared_ptr` objects are equivalent if they store the
|
| 148 |
+
same pointer value and share ownership. The weak form may fail
|
| 149 |
+
spuriously. See [[atomics.types.operations]].
|
|
|
|
|
|
|
| 150 |
|