[complex.tuple]

# 29 Numerics library [[numerics]](./#numerics)

## 29.4 Complex numbers [[complex.numbers]](complex.numbers#complex.tuple)

### 29.4.9 Tuple interface [complex.tuple]

[ð](#lib:tuple_size)

`template<class T>
struct tuple_size<complex<T>> : integral_constant<size_t, 2> {};

template<size_t I, class T>
struct tuple_element<I, complex<T>> {
  using type = T;
};
`

[1](#1)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L1143)

*Mandates*: I < 2 is true[.](#1.sentence-1)

[ð](#lib:get,complex)

`template<size_t I, class T>
  constexpr T& get(complex<T>& z) noexcept;
template<size_t I, class T>
  constexpr T&& get(complex<T>&& z) noexcept;
template<size_t I, class T>
  constexpr const T& get(const complex<T>& z) noexcept;
template<size_t I, class T>
  constexpr const T&& get(const complex<T>&& z) noexcept;
`

[2](#2)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L1161)

*Mandates*: I < 2 is true[.](#2.sentence-1)

[3](#3)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L1165)

*Returns*: A reference to the real part of z if I == 0 is true,
otherwise a reference to the imaginary part of z[.](#3.sentence-1)
