diff --git a/source/numerics.tex b/source/numerics.tex index 14308f349e..541da3bea6 100644 --- a/source/numerics.tex +++ b/source/numerics.tex @@ -289,6 +289,20 @@ template constexpr complex tan (const complex&); template constexpr complex tanh (const complex&); + // \ref{complex.tuple}, tuple interface + template struct tuple_size; + template struct tuple_element; + template struct tuple_size>; + template struct tuple_element>; + template + constexpr T& get(complex&) noexcept; + template + constexpr T&& get(complex&&) noexcept; + template + constexpr const T& get(const complex&) noexcept; + template + constexpr const T&& get(const complex&&) noexcept; + // \ref{complex.literals}, complex literals inline namespace literals { inline namespace complex_literals { @@ -1121,6 +1135,49 @@ The complex hyperbolic tangent of \tcode{x}. \end{itemdescr} +\rSec2[complex.tuple]{Tuple interface} + +\indexlibrarymember{tuple_size}{complex}% +\indexlibrarymember{tuple_element}{complex}% +\begin{itemdecl} +template +struct tuple_size> : integral_constant {}; + +template +struct tuple_element> { + using type = T; +}; +\end{itemdecl} + +\begin{itemdescr} +\pnum +\mandates +\tcode{I < 2} is \tcode{true}. +\end{itemdescr} + +\indexlibrarymember{get}{complex}% +\begin{itemdecl} +template + constexpr T& get(complex& z) noexcept; +template + constexpr T&& get(complex&& z) noexcept; +template + constexpr const T& get(const complex& z) noexcept; +template + constexpr const T&& get(const complex&& z) noexcept; +\end{itemdecl} + +\begin{itemdescr} +\pnum +\mandates +\tcode{I < 2} is \tcode{true}. + +\pnum +\returns +A reference to the real part of \tcode{z} if \tcode{I == 0} is \tcode{true}, +otherwise a reference to the imaginary part of \tcode{z}. +\end{itemdescr} + \rSec2[cmplx.over]{Additional overloads} \pnum diff --git a/source/support.tex b/source/support.tex index 4376a443cf..d835093b69 100644 --- a/source/support.tex +++ b/source/support.tex @@ -777,7 +777,7 @@ #define @\defnlibxname{cpp_lib_transparent_operators}@ 201510L // freestanding, also in \libheader{memory}, \libheader{functional} #define @\defnlibxname{cpp_lib_tuple_element_t}@ 201402L // freestanding, also in \libheader{tuple} -#define @\defnlibxname{cpp_lib_tuple_like}@ 202207L +#define @\defnlibxname{cpp_lib_tuple_like}@ 202311L // also in \libheader{utility}, \libheader{tuple}, \libheader{map}, \libheader{unordered_map} #define @\defnlibxname{cpp_lib_tuples_by_type}@ 201304L // freestanding, also in \libheader{utility}, \libheader{tuple} #define @\defnlibxname{cpp_lib_type_identity}@ 201806L // freestanding, also in \libheader{type_traits} diff --git a/source/utilities.tex b/source/utilities.tex index fd9453e2e3..c60a0ee244 100644 --- a/source/utilities.tex +++ b/source/utilities.tex @@ -1611,7 +1611,7 @@ A type \tcode{T} models and satisfies the exposition-only concept \exposconcept{tuple-like} if \tcode{remove_cvref_t} is a specialization of -\tcode{array}, \tcode{pair}, \tcode{tuple}, or \tcode{ranges::subrange}. +\tcode{array}, \tcode{complex}, \tcode{pair}, \tcode{tuple}, or \tcode{ranges::subrange}. \end{itemdescr} \rSec2[tuple.tuple]{Class template \tcode{tuple}}