From Jason Turner

[tuple.creation]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmp4ozrxyd8/{from.md → to.md} +10 -9
tmp/tmp4ozrxyd8/{from.md → to.md} RENAMED
@@ -6,14 +6,14 @@ parameter pack named `TTypes`; let j be in the range \[`0`,
6
  `sizeof...(UTypes)`) in order and Uⱼ be the jᵗʰ type in a template
7
  parameter pack named `UTypes`, where indexing is zero-based.
8
 
9
  ``` cpp
10
  template<class... Types>
11
- tuple<VTypes...> make_tuple(Types&&... t);
12
  ```
13
 
14
- Let Uᵢ be `decay<`Tᵢ`>::type` for each Tᵢ in `Types`. Then each Vᵢ in
15
  `VTypes` is `X&` if Uᵢ equals `reference_wrapper<X>`, otherwise Vᵢ is
16
  Uᵢ.
17
 
18
  *Returns:* `tuple<VTypes...>(std::forward<Types>(t)...)`.
19
 
@@ -28,11 +28,11 @@ creates a tuple of type
28
  tuple<int, int&, const float&>
29
  ```
30
 
31
  ``` cpp
32
  template<class... Types>
33
- tuple<Types&&...> forward_as_tuple(Types&&... t) noexcept;
34
  ```
35
 
36
  *Effects:* Constructs a tuple of references to the arguments in `t`
37
  suitable for forwarding as arguments to a function. Because the result
38
  may contain references to temporary variables, a program shall ensure
@@ -42,15 +42,16 @@ named variable).
42
 
43
  *Returns:* `tuple<Types&&...>(std::forward<Types>(t)...)`
44
 
45
  ``` cpp
46
  template<class... Types>
47
- tuple<Types&...> tie(Types&... t) noexcept;
48
  ```
49
 
50
- *Returns:* `tuple<Types&>(t...)`. When an argument in `t` is `ignore`,
51
- assigning any value to the corresponding tuple element has no effect.
 
52
 
53
  `tie` functions allow one to create tuples that unpack tuples into
54
  variables. `ignore` can be used for elements that are not needed:
55
 
56
  ``` cpp
@@ -59,16 +60,16 @@ tie(i, ignore, s) = make_tuple(42, 3.14, "C++");
59
  // i == 42, s == "C++"
60
  ```
61
 
62
  ``` cpp
63
  template <class... Tuples>
64
- tuple<CTypes...> tuple_cat(Tuples&&... tpls);
65
  ```
66
 
67
  In the following paragraphs, let Tᵢ be the iᵗʰ type in `Tuples`, Uᵢ be
68
- `remove_reference<Ti>::type`, and tpᵢ be the iᵗʰ parameter in the
69
- function parameter pack `tpls`, where all indexing is zero-based.
70
 
71
  *Requires:* For all i, Uᵢ shall be the type cvᵢ `tuple<`Argsᵢ...`>`,
72
  where cvᵢ is the (possibly empty) iᵗʰ cv-qualifier-seq and Argsᵢ is the
73
  parameter pack representing the element types in Uᵢ. Let {Aᵢₖ} be the
74
  kᵢᵗʰ type in Argsᵢ. For all Aᵢₖ the following requirements shall be
 
6
  `sizeof...(UTypes)`) in order and Uⱼ be the jᵗʰ type in a template
7
  parameter pack named `UTypes`, where indexing is zero-based.
8
 
9
  ``` cpp
10
  template<class... Types>
11
+ constexpr tuple<VTypes...> make_tuple(Types&&... t);
12
  ```
13
 
14
+ Let Uᵢ be `decay_t<`Tᵢ`>` for each Tᵢ in `Types`. Then each Vᵢ in
15
  `VTypes` is `X&` if Uᵢ equals `reference_wrapper<X>`, otherwise Vᵢ is
16
  Uᵢ.
17
 
18
  *Returns:* `tuple<VTypes...>(std::forward<Types>(t)...)`.
19
 
 
28
  tuple<int, int&, const float&>
29
  ```
30
 
31
  ``` cpp
32
  template<class... Types>
33
+ constexpr tuple<Types&&...> forward_as_tuple(Types&&... t) noexcept;
34
  ```
35
 
36
  *Effects:* Constructs a tuple of references to the arguments in `t`
37
  suitable for forwarding as arguments to a function. Because the result
38
  may contain references to temporary variables, a program shall ensure
 
42
 
43
  *Returns:* `tuple<Types&&...>(std::forward<Types>(t)...)`
44
 
45
  ``` cpp
46
  template<class... Types>
47
+ constexpr tuple<Types&...> tie(Types&... t) noexcept;
48
  ```
49
 
50
+ *Returns:* `tuple<Types&...>(t...)`. When an argument in `t` is
51
+ `ignore`, assigning any value to the corresponding tuple element has no
52
+ effect.
53
 
54
  `tie` functions allow one to create tuples that unpack tuples into
55
  variables. `ignore` can be used for elements that are not needed:
56
 
57
  ``` cpp
 
60
  // i == 42, s == "C++"
61
  ```
62
 
63
  ``` cpp
64
  template <class... Tuples>
65
+ constexpr tuple<CTypes...> tuple_cat(Tuples&&... tpls);
66
  ```
67
 
68
  In the following paragraphs, let Tᵢ be the iᵗʰ type in `Tuples`, Uᵢ be
69
+ `remove_reference_t<Ti>`, and tpᵢ be the iᵗʰ parameter in the function
70
+ parameter pack `tpls`, where all indexing is zero-based.
71
 
72
  *Requires:* For all i, Uᵢ shall be the type cvᵢ `tuple<`Argsᵢ...`>`,
73
  where cvᵢ is the (possibly empty) iᵗʰ cv-qualifier-seq and Argsᵢ is the
74
  parameter pack representing the element types in Uᵢ. Let {Aᵢₖ} be the
75
  kᵢᵗʰ type in Argsᵢ. For all Aᵢₖ the following requirements shall be