tmp/tmpg7on997i/{from.md → to.md}
RENAMED
|
@@ -1,11 +1,7 @@
|
|
| 1 |
### Tuple creation functions <a id="tuple.creation">[[tuple.creation]]</a>
|
| 2 |
|
| 3 |
-
In the function descriptions that follow, the members of a template
|
| 4 |
-
parameter pack `XTypes` are denoted by `X`ᵢ for i in \[`0`,
|
| 5 |
-
`sizeof...(`*X*`Types)`) in order, where indexing is zero-based.
|
| 6 |
-
|
| 7 |
``` cpp
|
| 8 |
template<class... TTypes>
|
| 9 |
constexpr tuple<unwrap_ref_decay_t<TTypes>...> make_tuple(TTypes&&... t);
|
| 10 |
```
|
| 11 |
|
|
@@ -14,11 +10,11 @@ template<class... TTypes>
|
|
| 14 |
|
| 15 |
[*Example 1*:
|
| 16 |
|
| 17 |
``` cpp
|
| 18 |
int i; float j;
|
| 19 |
-
make_tuple(1, ref(i), cref(j))
|
| 20 |
```
|
| 21 |
|
| 22 |
creates a tuple of type `tuple<int, int&, const float&>`.
|
| 23 |
|
| 24 |
— *end example*]
|
|
@@ -58,42 +54,31 @@ tie(i, ignore, s) = make_tuple(42, 3.14, "C++");
|
|
| 58 |
```
|
| 59 |
|
| 60 |
— *end example*]
|
| 61 |
|
| 62 |
``` cpp
|
| 63 |
-
template<
|
| 64 |
constexpr tuple<CTypes...> tuple_cat(Tuples&&... tpls);
|
| 65 |
```
|
| 66 |
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
*Returns:*
|
| 88 |
-
element `e_ik` in `eᵢ``...` with
|
| 89 |
-
|
| 90 |
-
``` cpp
|
| 91 |
-
get<kᵢ>(std::forward<$T_i$>($tp_i$))
|
| 92 |
-
```
|
| 93 |
-
|
| 94 |
-
for each valid kᵢ and each group `eᵢ` in order.
|
| 95 |
-
|
| 96 |
-
[*Note 1*: An implementation may support additional types in the
|
| 97 |
-
template parameter pack `Tuples` that support the `tuple`-like protocol,
|
| 98 |
-
such as `pair` and `array`. — *end note*]
|
| 99 |
|
|
|
|
| 1 |
### Tuple creation functions <a id="tuple.creation">[[tuple.creation]]</a>
|
| 2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
``` cpp
|
| 4 |
template<class... TTypes>
|
| 5 |
constexpr tuple<unwrap_ref_decay_t<TTypes>...> make_tuple(TTypes&&... t);
|
| 6 |
```
|
| 7 |
|
|
|
|
| 10 |
|
| 11 |
[*Example 1*:
|
| 12 |
|
| 13 |
``` cpp
|
| 14 |
int i; float j;
|
| 15 |
+
make_tuple(1, ref(i), cref(j));
|
| 16 |
```
|
| 17 |
|
| 18 |
creates a tuple of type `tuple<int, int&, const float&>`.
|
| 19 |
|
| 20 |
— *end example*]
|
|
|
|
| 54 |
```
|
| 55 |
|
| 56 |
— *end example*]
|
| 57 |
|
| 58 |
``` cpp
|
| 59 |
+
template<tuple-like... Tuples>
|
| 60 |
constexpr tuple<CTypes...> tuple_cat(Tuples&&... tpls);
|
| 61 |
```
|
| 62 |
|
| 63 |
+
Let n be `sizeof...(Tuples)`. For every integer 0 ≤ i < n:
|
| 64 |
+
|
| 65 |
+
- Let `Tᵢ` be the iᵗʰ type in `Tuples`.
|
| 66 |
+
- Let `Uᵢ` be `remove_cvref_t<``Tᵢ``>`.
|
| 67 |
+
- Let `tpᵢ` be the iᵗʰ element in the function parameter pack `tpls`.
|
| 68 |
+
- Let Sᵢ be `tuple_size_v<``Uᵢ``>`.
|
| 69 |
+
- Let Eᵢᵏ be `tuple_element_t<`k`, ``Uᵢ``>`.
|
| 70 |
+
- Let eᵢᵏ be `get<`k`>(std::forward<``Tᵢ``>(``tpᵢ``))`.
|
| 71 |
+
- Let Elemsᵢ be a pack of the types $E_i^0, \dotsc, E_i^{S_{i-1}}$.
|
| 72 |
+
- Let elemsᵢ be a pack of the expressions
|
| 73 |
+
$e_i^0, \dotsc, e_i^{S_{i-1}}$.
|
| 74 |
+
|
| 75 |
+
The types in `CTypes` are equal to the ordered sequence of the expanded
|
| 76 |
+
packs of types Elems₀`...`, Elems₁`...`, …, Elemsₙ₋₁`...`. Let `celems`
|
| 77 |
+
be the ordered sequence of the expanded packs of expressions
|
| 78 |
+
elems₀`...`, …, elemsₙ₋₁`...`.
|
| 79 |
+
|
| 80 |
+
*Mandates:* `(is_constructible_v<CTypes, decltype(celems)> && ...)` is
|
| 81 |
+
`true`.
|
| 82 |
+
|
| 83 |
+
*Returns:* `tuple<CTypes...>(celems...)`.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 84 |
|