tmp/tmp1kbilull/{from.md → to.md}
RENAMED
|
@@ -6,14 +6,14 @@ constexpr bool valueless_by_exception() const noexcept;
|
|
| 6 |
|
| 7 |
*Effects:* Returns `false` if and only if the `variant` holds a value.
|
| 8 |
|
| 9 |
[*Note 1*:
|
| 10 |
|
| 11 |
-
|
| 12 |
-
type-changing assignment or emplacement. The latter
|
| 13 |
-
`variant<float, int>` can become
|
| 14 |
-
instance by
|
| 15 |
|
| 16 |
``` cpp
|
| 17 |
struct S { operator int() { throw 42; }};
|
| 18 |
variant<float, int> v{12.f};
|
| 19 |
v.emplace<1>(S());
|
|
|
|
| 6 |
|
| 7 |
*Effects:* Returns `false` if and only if the `variant` holds a value.
|
| 8 |
|
| 9 |
[*Note 1*:
|
| 10 |
|
| 11 |
+
It is possible for a `variant` to hold no value if an exception is
|
| 12 |
+
thrown during a type-changing assignment or emplacement. The latter
|
| 13 |
+
means that even a `variant<float, int>` can become
|
| 14 |
+
`valueless_by_exception()`, for instance by
|
| 15 |
|
| 16 |
``` cpp
|
| 17 |
struct S { operator int() { throw 42; }};
|
| 18 |
variant<float, int> v{12.f};
|
| 19 |
v.emplace<1>(S());
|