tmp/tmps2z64q93/{from.md → to.md}
RENAMED
|
@@ -47,23 +47,30 @@ namespace std {
|
|
| 47 |
constexpr bool valueless_by_exception() const noexcept;
|
| 48 |
constexpr size_t index() const noexcept;
|
| 49 |
|
| 50 |
// [variant.swap], swap
|
| 51 |
constexpr void swap(variant&) noexcept(see below);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 52 |
};
|
| 53 |
}
|
| 54 |
```
|
| 55 |
|
| 56 |
Any instance of `variant` at any given time either holds a value of one
|
| 57 |
of its alternative types or holds no value. When an instance of
|
| 58 |
`variant` holds a value of alternative type `T`, it means that a value
|
| 59 |
of type `T`, referred to as the `variant` object’s *contained value*, is
|
| 60 |
-
|
| 61 |
-
are not permitted to use additional storage, such as dynamic memory, to
|
| 62 |
-
allocate the contained value.
|
| 63 |
|
| 64 |
All types in `Types` shall meet the *Cpp17Destructible* requirements (
|
| 65 |
[[cpp17.destructible]]).
|
| 66 |
|
| 67 |
A program that instantiates the definition of `variant` with no template
|
| 68 |
arguments is ill-formed.
|
| 69 |
|
|
|
|
|
|
|
|
|
|
|
|
| 47 |
constexpr bool valueless_by_exception() const noexcept;
|
| 48 |
constexpr size_t index() const noexcept;
|
| 49 |
|
| 50 |
// [variant.swap], swap
|
| 51 |
constexpr void swap(variant&) noexcept(see below);
|
| 52 |
+
|
| 53 |
+
// [variant.visit], visitation
|
| 54 |
+
template<class Self, class Visitor>
|
| 55 |
+
constexpr decltype(auto) visit(this Self&&, Visitor&&);
|
| 56 |
+
template<class R, class Self, class Visitor>
|
| 57 |
+
constexpr R visit(this Self&&, Visitor&&);
|
| 58 |
};
|
| 59 |
}
|
| 60 |
```
|
| 61 |
|
| 62 |
Any instance of `variant` at any given time either holds a value of one
|
| 63 |
of its alternative types or holds no value. When an instance of
|
| 64 |
`variant` holds a value of alternative type `T`, it means that a value
|
| 65 |
of type `T`, referred to as the `variant` object’s *contained value*, is
|
| 66 |
+
nested within [[intro.object]] the `variant` object.
|
|
|
|
|
|
|
| 67 |
|
| 68 |
All types in `Types` shall meet the *Cpp17Destructible* requirements (
|
| 69 |
[[cpp17.destructible]]).
|
| 70 |
|
| 71 |
A program that instantiates the definition of `variant` with no template
|
| 72 |
arguments is ill-formed.
|
| 73 |
|
| 74 |
+
If a program declares an explicit or partial specialization of
|
| 75 |
+
`variant`, the program is ill-formed, no diagnostic required.
|
| 76 |
+
|