From 453660589f8a545a70e841b16be0a63263c61105 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Sun, 5 Oct 2025 19:12:14 +0200 Subject: [PATCH] [simd.complex.access] Move into [simd.class] The complex accessors are member functions. Also adjust the subclause heading to fit the new surroundings. Fixes NB US 179-293 (C++26 CD). --- source/numerics.tex | 122 ++++++++++++++++++++++---------------------- 1 file changed, 61 insertions(+), 61 deletions(-) diff --git a/source/numerics.tex b/source/numerics.tex index 759683e2d7..892d43bb8d 100644 --- a/source/numerics.tex +++ b/source/numerics.tex @@ -17614,6 +17614,14 @@ template<@\exposconcept{simd-integral}@ I> constexpr resize_t operator[](const I& indices) const; + // \ref{simd.complex.access}, \tcode{basic_vec} complex accessors + constexpr auto real() const noexcept; + constexpr auto imag() const noexcept; + template<@\exposconcept{simd-floating-point}@ V> + constexpr void real(const V& v) noexcept; + template<@\exposconcept{simd-floating-point}@ V> + constexpr void imag(const V& v) noexcept; + // \ref{simd.unary}, \tcode{basic_vec} unary operators constexpr basic_vec& operator++() noexcept; constexpr basic_vec operator++(int) noexcept; @@ -17660,14 +17668,6 @@ friend constexpr mask_type operator>(const basic_vec&, const basic_vec&) noexcept; friend constexpr mask_type operator<(const basic_vec&, const basic_vec&) noexcept; - // \ref{simd.complex.access}, \tcode{basic_vec} complex-value accessors - constexpr auto real() const noexcept; - constexpr auto imag() const noexcept; - template<@\exposconcept{simd-floating-point}@ V> - constexpr void real(const V& v) noexcept; - template<@\exposconcept{simd-floating-point}@ V> - constexpr void imag(const V& v) noexcept; - // \ref{simd.cond}, \tcode{basic_vec} exposition only conditional operators friend constexpr basic_vec @\exposid{simd-select-impl}@( // \expos const mask_type&, const basic_vec&, const basic_vec&) noexcept; @@ -17951,6 +17951,59 @@ Equivalent to: \tcode{return permute(*this, indices);} \end{itemdescr} +\rSec3[simd.complex.access]{\tcode{basic_vec} complex accessors} + +\indexlibrarymember{real}{basic_vec} +\indexlibrarymember{imag}{basic_vec} +\begin{itemdecl} +constexpr auto real() const noexcept; +constexpr auto imag() const noexcept; +\end{itemdecl} + +\begin{itemdescr} +\pnum +\constraints +\tcode{\exposconcept{simd-complex}} is modeled. + +\pnum +\returns +An object of type \tcode{rebind_t} +where the $i^\text{th}$ element is initialized to the result of +\tcode{\placeholder{cmplx-func}(operator[]($i$))} for all $i$ in the range +\range{0}{size()}, where \placeholder{cmplx-func} is the corresponding function +from \libheader{complex}. +\end{itemdescr} + +\indexlibrarymember{real}{basic_vec} +\indexlibrarymember{imag}{basic_vec} +\begin{itemdecl} +template<@\exposconcept{simd-floating-point}@ V> + constexpr void real(const V& v) noexcept; +template<@\exposconcept{simd-floating-point}@ V> + constexpr void imag(const V& v) noexcept; +\end{itemdecl} + +\begin{itemdescr} +\pnum +\constraints +\begin{itemize} + \item + \tcode{\exposconcept{simd-complex}} is modeled, + \item + \tcode{\libconcept{same_as}} + is modeled, and + \item + \tcode{V::size() == size()} is \tcode{true}. +\end{itemize} + +\pnum +\effects +Replaces each element of the \tcode{basic_vec} object such that the +$i^\text{th}$ element is replaced with \tcode{value_type(v[$i$], +operator[]($i$).imag())} or \tcode{value_type(operator[]($i$).real(), v[$i$])} +for \tcode{real} and \tcode{imag} respectively, for all $i$ in the range \range{0}{size()}. +\end{itemdescr} + \rSec3[simd.unary]{\tcode{basic_vec} unary operators} \pnum @@ -18259,59 +18312,6 @@ operation. \end{itemdescr} -\rSec3[simd.complex.access]{\tcode{vec} complex accessors} - -\indexlibrarymember{real}{basic_vec} -\indexlibrarymember{imag}{basic_vec} -\begin{itemdecl} -constexpr auto real() const noexcept; -constexpr auto imag() const noexcept; -\end{itemdecl} - -\begin{itemdescr} -\pnum -\constraints -\tcode{\exposconcept{simd-complex}} is modeled. - -\pnum -\returns -An object of type \tcode{rebind_t} -where the $i^\text{th}$ element is initialized to the result of -\tcode{\placeholder{cmplx-func}(operator[]($i$))} for all $i$ in the range -\range{0}{size()}, where \placeholder{cmplx-func} is the corresponding function -from \libheader{complex}. -\end{itemdescr} - -\indexlibrarymember{real}{basic_vec} -\indexlibrarymember{imag}{basic_vec} -\begin{itemdecl} -template<@\exposconcept{simd-floating-point}@ V> - constexpr void real(const V& v) noexcept; -template<@\exposconcept{simd-floating-point}@ V> - constexpr void imag(const V& v) noexcept; -\end{itemdecl} - -\begin{itemdescr} -\pnum -\constraints -\begin{itemize} - \item - \tcode{\exposconcept{simd-complex}} is modeled, - \item - \tcode{\libconcept{same_as}} - is modeled, and - \item - \tcode{V::size() == size()} is \tcode{true}. -\end{itemize} - -\pnum -\effects -Replaces each element of the \tcode{basic_vec} object such that the -$i^\text{th}$ element is replaced with \tcode{value_type(v[$i$], -operator[]($i$).imag())} or \tcode{value_type(operator[]($i$).real(), v[$i$])} -for \tcode{real} and \tcode{imag} respectively, for all $i$ in the range \range{0}{size()}. -\end{itemdescr} - \rSec3[simd.cond]{\tcode{basic_vec} exposition only conditional operators} \begin{itemdecl}