From Jason Turner

[complex.tuple]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpaht1jfcp/{from.md → to.md} +30 -0
tmp/tmpaht1jfcp/{from.md → to.md} RENAMED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ### Tuple interface <a id="complex.tuple">[[complex.tuple]]</a>
2
+
3
+ ``` cpp
4
+ template<class T>
5
+ struct tuple_size<complex<T>> : integral_constant<size_t, 2> {};
6
+
7
+ template<size_t I, class T>
8
+ struct tuple_element<I, complex<T>> {
9
+ using type = T;
10
+ };
11
+ ```
12
+
13
+ *Mandates:* `I < 2` is `true`.
14
+
15
+ ``` cpp
16
+ template<size_t I, class T>
17
+ constexpr T& get(complex<T>& z) noexcept;
18
+ template<size_t I, class T>
19
+ constexpr T&& get(complex<T>&& z) noexcept;
20
+ template<size_t I, class T>
21
+ constexpr const T& get(const complex<T>& z) noexcept;
22
+ template<size_t I, class T>
23
+ constexpr const T&& get(const complex<T>&& z) noexcept;
24
+ ```
25
+
26
+ *Mandates:* `I < 2` is `true`.
27
+
28
+ *Returns:* A reference to the real part of `z` if `I == 0` is `true`,
29
+ otherwise a reference to the imaginary part of `z`.
30
+