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