tmp/tmpt3p7j2es/{from.md → to.md}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
-
#### Partial specialization for `weak_ptr` <a id="util.smartptr.atomic.weak">[[util.smartptr.atomic.weak]]</a>
|
| 2 |
|
| 3 |
``` cpp
|
| 4 |
namespace std {
|
| 5 |
template<class T> struct atomic<weak_ptr<T>> {
|
| 6 |
using value_type = weak_ptr<T>;
|
|
@@ -50,11 +50,11 @@ atomic(weak_ptr<T> desired) noexcept;
|
|
| 50 |
```
|
| 51 |
|
| 52 |
*Effects:* Initializes the object with the value `desired`.
|
| 53 |
Initialization is not an atomic operation [[intro.multithread]].
|
| 54 |
|
| 55 |
-
[*Note
|
| 56 |
race with its construction, for example, by communicating the address of
|
| 57 |
the just-constructed object `A` to another thread via
|
| 58 |
`memory_order::relaxed` operations on a suitable atomic pointer
|
| 59 |
variable, and then immediately accessing `A` in the receiving thread.
|
| 60 |
This results in undefined behavior. — *end note*]
|
|
|
|
| 1 |
+
##### Partial specialization for `weak_ptr` <a id="util.smartptr.atomic.weak">[[util.smartptr.atomic.weak]]</a>
|
| 2 |
|
| 3 |
``` cpp
|
| 4 |
namespace std {
|
| 5 |
template<class T> struct atomic<weak_ptr<T>> {
|
| 6 |
using value_type = weak_ptr<T>;
|
|
|
|
| 50 |
```
|
| 51 |
|
| 52 |
*Effects:* Initializes the object with the value `desired`.
|
| 53 |
Initialization is not an atomic operation [[intro.multithread]].
|
| 54 |
|
| 55 |
+
[*Note 2*: It is possible to have an access to an atomic object `A`
|
| 56 |
race with its construction, for example, by communicating the address of
|
| 57 |
the just-constructed object `A` to another thread via
|
| 58 |
`memory_order::relaxed` operations on a suitable atomic pointer
|
| 59 |
variable, and then immediately accessing `A` in the receiving thread.
|
| 60 |
This results in undefined behavior. — *end note*]
|