tmp/tmpi_6kcqh7/{from.md → to.md}
RENAMED
|
@@ -1,9 +1,9 @@
|
|
| 1 |
#### Modifiers <a id="variant.mod">[[variant.mod]]</a>
|
| 2 |
|
| 3 |
``` cpp
|
| 4 |
-
template<class T, class... Args> T& emplace(Args&&... args);
|
| 5 |
```
|
| 6 |
|
| 7 |
*Constraints:* `is_constructible_v<T, Args...>` is `true`, and `T`
|
| 8 |
occurs exactly once in `Types`.
|
| 9 |
|
|
@@ -14,11 +14,12 @@ return emplace<I>(std::forward<Args>(args)...);
|
|
| 14 |
```
|
| 15 |
|
| 16 |
where I is the zero-based index of `T` in `Types`.
|
| 17 |
|
| 18 |
``` cpp
|
| 19 |
-
template<class T, class U, class... Args>
|
|
|
|
| 20 |
```
|
| 21 |
|
| 22 |
*Constraints:* `is_constructible_v<T, initializer_list<U>&, Args...>` is
|
| 23 |
`true`, and `T` occurs exactly once in `Types`.
|
| 24 |
|
|
@@ -30,52 +31,53 @@ return emplace<I>(il, std::forward<Args>(args)...);
|
|
| 30 |
|
| 31 |
where I is the zero-based index of `T` in `Types`.
|
| 32 |
|
| 33 |
``` cpp
|
| 34 |
template<size_t I, class... Args>
|
| 35 |
-
variant_alternative_t<I, variant<Types...>>& emplace(Args&&... args);
|
| 36 |
```
|
| 37 |
|
| 38 |
*Mandates:* `I` < `sizeof...(Types)`.
|
| 39 |
|
| 40 |
*Constraints:* `is_constructible_v<``T_I``, Args...>` is `true`.
|
| 41 |
|
| 42 |
*Effects:* Destroys the currently contained value if
|
| 43 |
-
`valueless_by_exception()` is `false`. Then initializes
|
| 44 |
-
|
| 45 |
-
|
| 46 |
|
| 47 |
*Ensures:* `index()` is `I`.
|
| 48 |
|
| 49 |
*Returns:* A reference to the new contained value.
|
| 50 |
|
| 51 |
*Throws:* Any exception thrown during the initialization of the
|
| 52 |
contained value.
|
| 53 |
|
| 54 |
*Remarks:* If an exception is thrown during the initialization of the
|
| 55 |
-
contained value, the `variant`
|
| 56 |
|
| 57 |
``` cpp
|
| 58 |
template<size_t I, class U, class... Args>
|
| 59 |
-
variant_alternative_t<I, variant<Types...>>&
|
|
|
|
| 60 |
```
|
| 61 |
|
| 62 |
*Mandates:* `I` < `sizeof...(Types)`.
|
| 63 |
|
| 64 |
*Constraints:*
|
| 65 |
`is_constructible_v<``T_I``, initializer_list<U>&, Args...>` is `true`.
|
| 66 |
|
| 67 |
*Effects:* Destroys the currently contained value if
|
| 68 |
-
`valueless_by_exception()` is `false`. Then initializes
|
| 69 |
-
|
| 70 |
-
|
| 71 |
|
| 72 |
*Ensures:* `index()` is `I`.
|
| 73 |
|
| 74 |
*Returns:* A reference to the new contained value.
|
| 75 |
|
| 76 |
*Throws:* Any exception thrown during the initialization of the
|
| 77 |
contained value.
|
| 78 |
|
| 79 |
*Remarks:* If an exception is thrown during the initialization of the
|
| 80 |
-
contained value, the `variant`
|
| 81 |
|
|
|
|
| 1 |
#### Modifiers <a id="variant.mod">[[variant.mod]]</a>
|
| 2 |
|
| 3 |
``` cpp
|
| 4 |
+
template<class T, class... Args> constexpr T& emplace(Args&&... args);
|
| 5 |
```
|
| 6 |
|
| 7 |
*Constraints:* `is_constructible_v<T, Args...>` is `true`, and `T`
|
| 8 |
occurs exactly once in `Types`.
|
| 9 |
|
|
|
|
| 14 |
```
|
| 15 |
|
| 16 |
where I is the zero-based index of `T` in `Types`.
|
| 17 |
|
| 18 |
``` cpp
|
| 19 |
+
template<class T, class U, class... Args>
|
| 20 |
+
constexpr T& emplace(initializer_list<U> il, Args&&... args);
|
| 21 |
```
|
| 22 |
|
| 23 |
*Constraints:* `is_constructible_v<T, initializer_list<U>&, Args...>` is
|
| 24 |
`true`, and `T` occurs exactly once in `Types`.
|
| 25 |
|
|
|
|
| 31 |
|
| 32 |
where I is the zero-based index of `T` in `Types`.
|
| 33 |
|
| 34 |
``` cpp
|
| 35 |
template<size_t I, class... Args>
|
| 36 |
+
constexpr variant_alternative_t<I, variant<Types...>>& emplace(Args&&... args);
|
| 37 |
```
|
| 38 |
|
| 39 |
*Mandates:* `I` < `sizeof...(Types)`.
|
| 40 |
|
| 41 |
*Constraints:* `is_constructible_v<``T_I``, Args...>` is `true`.
|
| 42 |
|
| 43 |
*Effects:* Destroys the currently contained value if
|
| 44 |
+
`valueless_by_exception()` is `false`. Then direct-non-list-initializes
|
| 45 |
+
the contained value of type `T_I` with the arguments
|
| 46 |
+
`std::forward<Args>(args)...`.
|
| 47 |
|
| 48 |
*Ensures:* `index()` is `I`.
|
| 49 |
|
| 50 |
*Returns:* A reference to the new contained value.
|
| 51 |
|
| 52 |
*Throws:* Any exception thrown during the initialization of the
|
| 53 |
contained value.
|
| 54 |
|
| 55 |
*Remarks:* If an exception is thrown during the initialization of the
|
| 56 |
+
contained value, the `variant` is permitted to not hold a value.
|
| 57 |
|
| 58 |
``` cpp
|
| 59 |
template<size_t I, class U, class... Args>
|
| 60 |
+
constexpr variant_alternative_t<I, variant<Types...>>&
|
| 61 |
+
emplace(initializer_list<U> il, Args&&... args);
|
| 62 |
```
|
| 63 |
|
| 64 |
*Mandates:* `I` < `sizeof...(Types)`.
|
| 65 |
|
| 66 |
*Constraints:*
|
| 67 |
`is_constructible_v<``T_I``, initializer_list<U>&, Args...>` is `true`.
|
| 68 |
|
| 69 |
*Effects:* Destroys the currently contained value if
|
| 70 |
+
`valueless_by_exception()` is `false`. Then direct-non-list-initializes
|
| 71 |
+
the contained value of type `T_I` with
|
| 72 |
+
`il, std::forward<Args>(args)...`.
|
| 73 |
|
| 74 |
*Ensures:* `index()` is `I`.
|
| 75 |
|
| 76 |
*Returns:* A reference to the new contained value.
|
| 77 |
|
| 78 |
*Throws:* Any exception thrown during the initialization of the
|
| 79 |
contained value.
|
| 80 |
|
| 81 |
*Remarks:* If an exception is thrown during the initialization of the
|
| 82 |
+
contained value, the `variant` is permitted to not hold a value.
|
| 83 |
|