Skip to content

Commit f3778a3

Browse files
jensmaurertkoeppe
authored andcommitted
[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).
1 parent 25c2211 commit f3778a3

File tree

1 file changed

+61
-61
lines changed

1 file changed

+61
-61
lines changed

source/numerics.tex

Lines changed: 61 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -17600,6 +17600,14 @@
1760017600
template<@\exposconcept{simd-integral}@ I>
1760117601
constexpr resize_t<I::size(), basic_vec> operator[](const I& indices) const;
1760217602

17603+
// \ref{simd.complex.access}, \tcode{basic_vec} complex accessors
17604+
constexpr auto real() const noexcept;
17605+
constexpr auto imag() const noexcept;
17606+
template<@\exposconcept{simd-floating-point}@ V>
17607+
constexpr void real(const V& v) noexcept;
17608+
template<@\exposconcept{simd-floating-point}@ V>
17609+
constexpr void imag(const V& v) noexcept;
17610+
1760317611
// \ref{simd.unary}, \tcode{basic_vec} unary operators
1760417612
constexpr basic_vec& operator++() noexcept;
1760517613
constexpr basic_vec operator++(int) noexcept;
@@ -17646,14 +17654,6 @@
1764617654
friend constexpr mask_type operator>(const basic_vec&, const basic_vec&) noexcept;
1764717655
friend constexpr mask_type operator<(const basic_vec&, const basic_vec&) noexcept;
1764817656

17649-
// \ref{simd.complex.access}, \tcode{basic_vec} complex-value accessors
17650-
constexpr auto real() const noexcept;
17651-
constexpr auto imag() const noexcept;
17652-
template<@\exposconcept{simd-floating-point}@ V>
17653-
constexpr void real(const V& v) noexcept;
17654-
template<@\exposconcept{simd-floating-point}@ V>
17655-
constexpr void imag(const V& v) noexcept;
17656-
1765717657
// \ref{simd.cond}, \tcode{basic_vec} exposition only conditional operators
1765817658
friend constexpr basic_vec @\exposid{simd-select-impl}@( // \expos
1765917659
const mask_type&, const basic_vec&, const basic_vec&) noexcept;
@@ -17937,6 +17937,59 @@
1793717937
Equivalent to: \tcode{return permute(*this, indices);}
1793817938
\end{itemdescr}
1793917939

17940+
\rSec3[simd.complex.access]{\tcode{basic_vec} complex accessors}
17941+
17942+
\indexlibrarymember{real}{basic_vec}
17943+
\indexlibrarymember{imag}{basic_vec}
17944+
\begin{itemdecl}
17945+
constexpr auto real() const noexcept;
17946+
constexpr auto imag() const noexcept;
17947+
\end{itemdecl}
17948+
17949+
\begin{itemdescr}
17950+
\pnum
17951+
\constraints
17952+
\tcode{\exposconcept{simd-complex}<basic_vec>} is modeled.
17953+
17954+
\pnum
17955+
\returns
17956+
An object of type \tcode{rebind_t<typename T::value_type, basic_vec>}
17957+
where the $i^\text{th}$ element is initialized to the result of
17958+
\tcode{\placeholder{cmplx-func}(operator[]($i$))} for all $i$ in the range
17959+
\range{0}{size()}, where \placeholder{cmplx-func} is the corresponding function
17960+
from \libheader{complex}.
17961+
\end{itemdescr}
17962+
17963+
\indexlibrarymember{real}{basic_vec}
17964+
\indexlibrarymember{imag}{basic_vec}
17965+
\begin{itemdecl}
17966+
template<@\exposconcept{simd-floating-point}@ V>
17967+
constexpr void real(const V& v) noexcept;
17968+
template<@\exposconcept{simd-floating-point}@ V>
17969+
constexpr void imag(const V& v) noexcept;
17970+
\end{itemdecl}
17971+
17972+
\begin{itemdescr}
17973+
\pnum
17974+
\constraints
17975+
\begin{itemize}
17976+
\item
17977+
\tcode{\exposconcept{simd-complex}<basic_vec>} is modeled,
17978+
\item
17979+
\tcode{\libconcept{same_as}<typename V::value_type, typename T::value_type>}
17980+
is modeled, and
17981+
\item
17982+
\tcode{V::size() == size()} is \tcode{true}.
17983+
\end{itemize}
17984+
17985+
\pnum
17986+
\effects
17987+
Replaces each element of the \tcode{basic_vec} object such that the
17988+
$i^\text{th}$ element is replaced with \tcode{value_type(v[$i$],
17989+
operator[]($i$).imag())} or \tcode{value_type(operator[]($i$).real(), v[$i$])}
17990+
for \tcode{real} and \tcode{imag} respectively, for all $i$ in the range \range{0}{size()}.
17991+
\end{itemdescr}
17992+
1794017993
\rSec3[simd.unary]{\tcode{basic_vec} unary operators}
1794117994

1794217995
\pnum
@@ -18245,59 +18298,6 @@
1824518298
operation.
1824618299
\end{itemdescr}
1824718300

18248-
\rSec3[simd.complex.access]{\tcode{vec} complex accessors}
18249-
18250-
\indexlibrarymember{real}{basic_vec}
18251-
\indexlibrarymember{imag}{basic_vec}
18252-
\begin{itemdecl}
18253-
constexpr auto real() const noexcept;
18254-
constexpr auto imag() const noexcept;
18255-
\end{itemdecl}
18256-
18257-
\begin{itemdescr}
18258-
\pnum
18259-
\constraints
18260-
\tcode{\exposconcept{simd-complex}<basic_vec>} is modeled.
18261-
18262-
\pnum
18263-
\returns
18264-
An object of type \tcode{rebind_t<typename T::value_type, basic_vec>}
18265-
where the $i^\text{th}$ element is initialized to the result of
18266-
\tcode{\placeholder{cmplx-func}(operator[]($i$))} for all $i$ in the range
18267-
\range{0}{size()}, where \placeholder{cmplx-func} is the corresponding function
18268-
from \libheader{complex}.
18269-
\end{itemdescr}
18270-
18271-
\indexlibrarymember{real}{basic_vec}
18272-
\indexlibrarymember{imag}{basic_vec}
18273-
\begin{itemdecl}
18274-
template<@\exposconcept{simd-floating-point}@ V>
18275-
constexpr void real(const V& v) noexcept;
18276-
template<@\exposconcept{simd-floating-point}@ V>
18277-
constexpr void imag(const V& v) noexcept;
18278-
\end{itemdecl}
18279-
18280-
\begin{itemdescr}
18281-
\pnum
18282-
\constraints
18283-
\begin{itemize}
18284-
\item
18285-
\tcode{\exposconcept{simd-complex}<basic_vec>} is modeled,
18286-
\item
18287-
\tcode{\libconcept{same_as}<typename V::value_type, typename T::value_type>}
18288-
is modeled, and
18289-
\item
18290-
\tcode{V::size() == size()} is \tcode{true}.
18291-
\end{itemize}
18292-
18293-
\pnum
18294-
\effects
18295-
Replaces each element of the \tcode{basic_vec} object such that the
18296-
$i^\text{th}$ element is replaced with \tcode{value_type(v[$i$],
18297-
operator[]($i$).imag())} or \tcode{value_type(operator[]($i$).real(), v[$i$])}
18298-
for \tcode{real} and \tcode{imag} respectively, for all $i$ in the range \range{0}{size()}.
18299-
\end{itemdescr}
18300-
1830118301
\rSec3[simd.cond]{\tcode{basic_vec} exposition only conditional operators}
1830218302

1830318303
\begin{itemdecl}

0 commit comments

Comments
 (0)