|
289 | 289 | template<class T> constexpr complex<T> tan (const complex<T>&);
|
290 | 290 | template<class T> constexpr complex<T> tanh (const complex<T>&);
|
291 | 291 |
|
| 292 | + // \ref{complex.tuple}, tuple interface |
| 293 | + template<class T> struct tuple_size; |
| 294 | + template<size_t I, class T> struct tuple_element; |
| 295 | + template<class T> struct tuple_size<complex<T>>; |
| 296 | + template<size_t I, class T> struct tuple_element<I, complex<T>>; |
| 297 | + template<size_t I, class T> |
| 298 | + constexpr T& get(complex<T>&) noexcept; |
| 299 | + template<size_t I, class T> |
| 300 | + constexpr T&& get(complex<T>&&) noexcept; |
| 301 | + template<size_t I, class T> |
| 302 | + constexpr const T& get(const complex<T>&) noexcept; |
| 303 | + template<size_t I, class T> |
| 304 | + constexpr const T&& get(const complex<T>&&) noexcept; |
| 305 | + |
292 | 306 | // \ref{complex.literals}, complex literals
|
293 | 307 | inline namespace literals {
|
294 | 308 | inline namespace complex_literals {
|
|
1121 | 1135 | The complex hyperbolic tangent of \tcode{x}.
|
1122 | 1136 | \end{itemdescr}
|
1123 | 1137 |
|
| 1138 | +\rSec2[complex.tuple]{Tuple interface} |
| 1139 | + |
| 1140 | +\indexlibraryglobal{tuple_size}% |
| 1141 | +\indexlibraryglobal{tuple_element}% |
| 1142 | +\begin{itemdecl} |
| 1143 | +template<class T> |
| 1144 | +struct tuple_size<complex<T>> : integral_constant<size_t, 2> {}; |
| 1145 | + |
| 1146 | +template<size_t I, class T> |
| 1147 | +struct tuple_element<I, complex<T>> { |
| 1148 | + using type = T; |
| 1149 | +}; |
| 1150 | +\end{itemdecl} |
| 1151 | + |
| 1152 | +\begin{itemdescr} |
| 1153 | +\pnum |
| 1154 | +\mandates |
| 1155 | +\tcode{I < 2} is \tcode{true}. |
| 1156 | +\end{itemdescr} |
| 1157 | + |
| 1158 | +\indexlibrarymember{get}{complex}% |
| 1159 | +\begin{itemdecl} |
| 1160 | +template<size_t I, class T> |
| 1161 | + constexpr T& get(complex<T>& z) noexcept; |
| 1162 | +template<size_t I, class T> |
| 1163 | + constexpr T&& get(complex<T>&& z) noexcept; |
| 1164 | +template<size_t I, class T> |
| 1165 | + constexpr const T& get(const complex<T>& z) noexcept; |
| 1166 | +template<size_t I, class T> |
| 1167 | + constexpr const T&& get(const complex<T>&& z) noexcept; |
| 1168 | +\end{itemdecl} |
| 1169 | + |
| 1170 | +\begin{itemdescr} |
| 1171 | +\pnum |
| 1172 | +\mandates |
| 1173 | +\tcode{I < 2} is \tcode{true}. |
| 1174 | + |
| 1175 | +\pnum |
| 1176 | +\returns |
| 1177 | +A reference to the real part of \tcode{z} if \tcode{I == 0} is \tcode{true}, |
| 1178 | +otherwise a reference to the imaginary part of \tcode{z}. |
| 1179 | +\end{itemdescr} |
| 1180 | + |
1124 | 1181 | \rSec2[cmplx.over]{Additional overloads}
|
1125 | 1182 |
|
1126 | 1183 | \pnum
|
|
0 commit comments