tmp/tmpt1dkh44j/{from.md → to.md}
RENAMED
|
@@ -16,22 +16,22 @@ The default constructor of `exception_ptr` produces the null value of
|
|
| 16 |
the type.
|
| 17 |
|
| 18 |
`exception_ptr` shall not be implicitly convertible to any arithmetic,
|
| 19 |
enumeration, or pointer type.
|
| 20 |
|
| 21 |
-
[*Note 1*: An implementation
|
| 22 |
-
|
| 23 |
|
| 24 |
For purposes of determining the presence of a data race, operations on
|
| 25 |
`exception_ptr` objects shall access and modify only the `exception_ptr`
|
| 26 |
objects themselves and not the exceptions they refer to. Use of
|
| 27 |
`rethrow_exception` on `exception_ptr` objects that refer to the same
|
| 28 |
exception object shall not introduce a data race.
|
| 29 |
|
| 30 |
[*Note 2*: If `rethrow_exception` rethrows the same exception object
|
| 31 |
(rather than a copy), concurrent access to that rethrown exception
|
| 32 |
-
object
|
| 33 |
`exception_ptr` objects that refer to a particular exception do not
|
| 34 |
introduce a data race. — *end note*]
|
| 35 |
|
| 36 |
``` cpp
|
| 37 |
exception_ptr current_exception() noexcept;
|
|
@@ -53,21 +53,29 @@ creates a new copy each time it is called. — *end note*]
|
|
| 53 |
If the attempt to copy the current exception object throws an exception,
|
| 54 |
the function returns an `exception_ptr` object that refers to the thrown
|
| 55 |
exception or, if this is not possible, to an instance of
|
| 56 |
`bad_exception`.
|
| 57 |
|
| 58 |
-
[*Note 4*: The copy constructor of the thrown exception
|
| 59 |
so the implementation is allowed to substitute a `bad_exception` object
|
| 60 |
to avoid infinite recursion. — *end note*]
|
| 61 |
|
| 62 |
``` cpp
|
| 63 |
[[noreturn]] void rethrow_exception(exception_ptr p);
|
| 64 |
```
|
| 65 |
|
| 66 |
*Preconditions:* `p` is not a null pointer.
|
| 67 |
|
| 68 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 69 |
|
| 70 |
``` cpp
|
| 71 |
template<class E> exception_ptr make_exception_ptr(E e) noexcept;
|
| 72 |
```
|
| 73 |
|
|
|
|
| 16 |
the type.
|
| 17 |
|
| 18 |
`exception_ptr` shall not be implicitly convertible to any arithmetic,
|
| 19 |
enumeration, or pointer type.
|
| 20 |
|
| 21 |
+
[*Note 1*: An implementation can use a reference-counted smart pointer
|
| 22 |
+
as `exception_ptr`. — *end note*]
|
| 23 |
|
| 24 |
For purposes of determining the presence of a data race, operations on
|
| 25 |
`exception_ptr` objects shall access and modify only the `exception_ptr`
|
| 26 |
objects themselves and not the exceptions they refer to. Use of
|
| 27 |
`rethrow_exception` on `exception_ptr` objects that refer to the same
|
| 28 |
exception object shall not introduce a data race.
|
| 29 |
|
| 30 |
[*Note 2*: If `rethrow_exception` rethrows the same exception object
|
| 31 |
(rather than a copy), concurrent access to that rethrown exception
|
| 32 |
+
object can introduce a data race. Changes in the number of
|
| 33 |
`exception_ptr` objects that refer to a particular exception do not
|
| 34 |
introduce a data race. — *end note*]
|
| 35 |
|
| 36 |
``` cpp
|
| 37 |
exception_ptr current_exception() noexcept;
|
|
|
|
| 53 |
If the attempt to copy the current exception object throws an exception,
|
| 54 |
the function returns an `exception_ptr` object that refers to the thrown
|
| 55 |
exception or, if this is not possible, to an instance of
|
| 56 |
`bad_exception`.
|
| 57 |
|
| 58 |
+
[*Note 4*: The copy constructor of the thrown exception can also fail,
|
| 59 |
so the implementation is allowed to substitute a `bad_exception` object
|
| 60 |
to avoid infinite recursion. — *end note*]
|
| 61 |
|
| 62 |
``` cpp
|
| 63 |
[[noreturn]] void rethrow_exception(exception_ptr p);
|
| 64 |
```
|
| 65 |
|
| 66 |
*Preconditions:* `p` is not a null pointer.
|
| 67 |
|
| 68 |
+
*Effects:* Let u be the exception object to which `p` refers, or a copy
|
| 69 |
+
of that exception object. It is unspecified whether a copy is made, and
|
| 70 |
+
memory for the copy is allocated in an unspecified way.
|
| 71 |
+
|
| 72 |
+
- If allocating memory to form u fails, throws an instance of
|
| 73 |
+
`bad_alloc`;
|
| 74 |
+
- otherwise, if copying the exception to which `p` refers to form u
|
| 75 |
+
throws an exception, throws that exception;
|
| 76 |
+
- otherwise, throws u.
|
| 77 |
|
| 78 |
``` cpp
|
| 79 |
template<class E> exception_ptr make_exception_ptr(E e) noexcept;
|
| 80 |
```
|
| 81 |
|