From Jason Turner

[tuple.cnstr]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmp6iny9b1p/{from.md → to.md} +12 -6
tmp/tmp6iny9b1p/{from.md → to.md} RENAMED
@@ -1,10 +1,16 @@
1
  #### Construction <a id="tuple.cnstr">[[tuple.cnstr]]</a>
2
 
3
  For each `tuple` constructor, an exception is thrown only if the
4
  construction of one of the types in `Types` throws an exception.
5
 
 
 
 
 
 
 
6
  In the constructor descriptions that follow, let i be in the range
7
  \[`0`, `sizeof...(Types)`) in order, Tᵢ be the iᵗʰ type in `Types`, and
8
  Uᵢ be the iᵗʰ type in a template parameter pack named `UTypes`, where
9
  indexing is zero-based.
10
 
@@ -15,21 +21,21 @@ constexpr tuple();
15
  *Requires:* `is_default_constructible<`Tᵢ`>::value` is true for all i.
16
 
17
  *Effects:* Value initializes each element.
18
 
19
  ``` cpp
20
- explicit tuple(const Types&...);
21
  ```
22
 
23
  *Requires:* `is_copy_constructible<`Tᵢ`>::value` is true for all i.
24
 
25
  *Effects:* Initializes each element with the value of the corresponding
26
  parameter.
27
 
28
  ``` cpp
29
  template <class... UTypes>
30
- explicit tuple(UTypes&&... u);
31
  ```
32
 
33
  *Requires:* `sizeof...(Types)` `==` `sizeof...(UTypes)`.
34
  `is_constructible<`Tᵢ`, `Uᵢ`&&>::value` is `true` for all i.
35
 
@@ -57,11 +63,11 @@ tuple(tuple&& u) = default;
57
 
58
  *Effects:* For all i, initializes the iᵗʰ element of `*this` with
59
  `std::forward<`Tᵢ`>(get<`i`>(u))`.
60
 
61
  ``` cpp
62
- template <class... UTypes> tuple(const tuple<UTypes...>& u);
63
  ```
64
 
65
  *Requires:* `sizeof...(Types)` `==` `sizeof...(UTypes)`.
66
  `is_constructible<`Tᵢ`, const `Uᵢ`&>::value` is `true` for all i.
67
 
@@ -70,11 +76,11 @@ element of `u`.
70
 
71
  This constructor shall not participate in overload resolution unless
72
  `const `Uᵢ`&` is implicitly convertible to Tᵢ for all i.
73
 
74
  ``` cpp
75
- template <class... UTypes> tuple(tuple<UTypes...>&& u);
76
  ```
77
 
78
  *Requires:* `sizeof...(Types)` `==` `sizeof...(UTypes)`.
79
  `is_constructible<`Tᵢ`, `Uᵢ`&&>::value` is `true` for all i.
80
 
@@ -84,11 +90,11 @@ template <class... UTypes> tuple(tuple<UTypes...>&& u);
84
  This constructor shall not participate in overload resolution unless
85
  each type in `UTypes` is implicitly convertible to its corresponding
86
  type in `Types`.
87
 
88
  ``` cpp
89
- template <class U1, class U2> tuple(const pair<U1, U2>& u);
90
  ```
91
 
92
  *Requires:* `sizeof...(Types) == 2`.
93
  `is_constructible<`T₀`, const U1&>::value` is `true` for the first type
94
  T₀ in `Types` and `is_constructible<`T₁`, const U2&>::value` is `true`
@@ -100,11 +106,11 @@ element with `u.second`.
100
  This constructor shall not participate in overload resolution unless
101
  `const U1&` is implicitly convertible to T₀ and `const U2&` is
102
  implicitly convertible to T₁.
103
 
104
  ``` cpp
105
- template <class U1, class U2> tuple(pair<U1, U2>&& u);
106
  ```
107
 
108
  *Requires:* `sizeof...(Types) == 2`.
109
  `is_constructible<`T₀`, U1&&>::value` is `true` for the first type T₀ in
110
  `Types` and `is_constructible<`T₁`, U2&&>::value` is `true` for the
 
1
  #### Construction <a id="tuple.cnstr">[[tuple.cnstr]]</a>
2
 
3
  For each `tuple` constructor, an exception is thrown only if the
4
  construction of one of the types in `Types` throws an exception.
5
 
6
+ The defaulted move and copy constructor, respectively, of `tuple` shall
7
+ be a `constexpr` function if and only if all required element-wise
8
+ initializations for copy and move, respectively, would satisfy the
9
+ requirements for a `constexpr` function. The defaulted move and copy
10
+ constructor of `tuple<>` shall be `constexpr` functions.
11
+
12
  In the constructor descriptions that follow, let i be in the range
13
  \[`0`, `sizeof...(Types)`) in order, Tᵢ be the iᵗʰ type in `Types`, and
14
  Uᵢ be the iᵗʰ type in a template parameter pack named `UTypes`, where
15
  indexing is zero-based.
16
 
 
21
  *Requires:* `is_default_constructible<`Tᵢ`>::value` is true for all i.
22
 
23
  *Effects:* Value initializes each element.
24
 
25
  ``` cpp
26
+ constexpr explicit tuple(const Types&...);
27
  ```
28
 
29
  *Requires:* `is_copy_constructible<`Tᵢ`>::value` is true for all i.
30
 
31
  *Effects:* Initializes each element with the value of the corresponding
32
  parameter.
33
 
34
  ``` cpp
35
  template <class... UTypes>
36
+ constexpr explicit tuple(UTypes&&... u);
37
  ```
38
 
39
  *Requires:* `sizeof...(Types)` `==` `sizeof...(UTypes)`.
40
  `is_constructible<`Tᵢ`, `Uᵢ`&&>::value` is `true` for all i.
41
 
 
63
 
64
  *Effects:* For all i, initializes the iᵗʰ element of `*this` with
65
  `std::forward<`Tᵢ`>(get<`i`>(u))`.
66
 
67
  ``` cpp
68
+ template <class... UTypes> constexpr tuple(const tuple<UTypes...>& u);
69
  ```
70
 
71
  *Requires:* `sizeof...(Types)` `==` `sizeof...(UTypes)`.
72
  `is_constructible<`Tᵢ`, const `Uᵢ`&>::value` is `true` for all i.
73
 
 
76
 
77
  This constructor shall not participate in overload resolution unless
78
  `const `Uᵢ`&` is implicitly convertible to Tᵢ for all i.
79
 
80
  ``` cpp
81
+ template <class... UTypes> constexpr tuple(tuple<UTypes...>&& u);
82
  ```
83
 
84
  *Requires:* `sizeof...(Types)` `==` `sizeof...(UTypes)`.
85
  `is_constructible<`Tᵢ`, `Uᵢ`&&>::value` is `true` for all i.
86
 
 
90
  This constructor shall not participate in overload resolution unless
91
  each type in `UTypes` is implicitly convertible to its corresponding
92
  type in `Types`.
93
 
94
  ``` cpp
95
+ template <class U1, class U2> constexpr tuple(const pair<U1, U2>& u);
96
  ```
97
 
98
  *Requires:* `sizeof...(Types) == 2`.
99
  `is_constructible<`T₀`, const U1&>::value` is `true` for the first type
100
  T₀ in `Types` and `is_constructible<`T₁`, const U2&>::value` is `true`
 
106
  This constructor shall not participate in overload resolution unless
107
  `const U1&` is implicitly convertible to T₀ and `const U2&` is
108
  implicitly convertible to T₁.
109
 
110
  ``` cpp
111
+ template <class U1, class U2> constexpr tuple(pair<U1, U2>&& u);
112
  ```
113
 
114
  *Requires:* `sizeof...(Types) == 2`.
115
  `is_constructible<`T₀`, U1&&>::value` is `true` for the first type T₀ in
116
  `Types` and `is_constructible<`T₁`, U2&&>::value` is `true` for the