Skip to content

Commit 1fa2078

Browse files
committed
P3050R2 Fix C++26 by optimizing linalg::conjugated for noncomplex value types
Editorial notes: * The editing instructions in the paper are rather unclear. We have applied the wording of the paper and replaced the original wording entirely, since the paper does not indicate deletions and insertions. Future versions of this draft may start rejecting instructions of such deficiency. * The leading words "the value" have been inserted in a "Returns:" element consisting of a list where the list items would otherwise have started with a codeblock (which does not get formatted correctly). * The feature test macro value is bumpted to 202412, since the previous motion (P3222R0) already uses 202411.
1 parent 47f19eb commit 1fa2078

File tree

2 files changed

+24
-5
lines changed

2 files changed

+24
-5
lines changed

source/numerics.tex

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12808,21 +12808,40 @@
1280812808
\begin{itemdescr}
1280912809
\pnum
1281012810
Let \tcode{A} be
12811+
\begin{itemize}
12812+
\item
1281112813
\tcode{remove_cvref_t<decltype(a.accessor().nested_accessor())>}
12812-
if \tcode{Accessor} is a specialization of \tcode{conjugated_accessor}, and
12813-
otherwise \tcode{conjugated_accessor<Accessor>}.
12814+
if \tcode{Accessor} is a specialization of \tcode{conjugated_accessor}; otherwise,
12815+
\item
12816+
\tcode{Accessor} if \tcode{remove_cvref_t<ElementType>} is an arithmetic type; otherwise,
12817+
\item
12818+
\tcode{Accessor} if the expression \tcode{conj(E)} is not valid for any subexpression \tcode{E}
12819+
whose type \tcode{T} is expression-equivalent to \tcode{remove_cvref_t<ElementType>}
12820+
with overload resolution performed in a context that includes the declaration
12821+
\tcode{template<class T> conj(const T\&) = delete;}; and otherwise,
12822+
\item
12823+
\tcode{conjugated_accessor<Accessor>}.
12824+
\end{itemize}
1281412825

1281512826
\pnum
1281612827
\returns
1281712828
\begin{itemize}
1281812829
\item
12819-
If \tcode{Accessor} is a specialization of \tcode{conjugated_accessor},
12830+
The value
1282012831
\begin{codeblock}
1282112832
mdspan<typename A::element_type, Extents, Layout, A>(a.data_handle(), a.mapping(),
1282212833
a.accessor().nested_accessor())
1282312834
\end{codeblock}
12835+
if \tcode{Accessor} is a specialization of \tcode{conjugated_accessor}; otherwise,
1282412836
\item
12825-
otherwise,
12837+
\tcode{a} if \tcode{remove_cvref_t<ElementType>} is an arithmetic type; otherwise,
12838+
\item
12839+
\tcode{a} if the expression \tcode{conj(E)} is not valid for any subexpression \tcode{E}
12840+
whose type \tcode{T} is expression-equivalent to \tcode{remove_cvref_t<ElementType>}
12841+
with overload resolution performed in a context that includes the declaration
12842+
\tcode{template<class T> conj(const T\&) = delete;}; and otherwise,
12843+
\item
12844+
the value
1282612845
\begin{codeblock}
1282712846
mdspan<typename A::element_type, Extents, Layout, A>(a.data_handle(), a.mapping(),
1282812847
conjugated_accessor(a.accessor()))

source/support.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -710,7 +710,7 @@
710710
#define @\defnlibxname{cpp_lib_jthread}@ 201911L // also in \libheader{stop_token}, \libheader{thread}
711711
#define @\defnlibxname{cpp_lib_latch}@ 201907L // also in \libheader{latch}
712712
#define @\defnlibxname{cpp_lib_launder}@ 201606L // freestanding, also in \libheader{new}
713-
#define @\defnlibxname{cpp_lib_linalg}@ 202411L // also in \libheader{linalg}
713+
#define @\defnlibxname{cpp_lib_linalg}@ 202412L // also in \libheader{linalg}
714714
#define @\defnlibxname{cpp_lib_list_remove_return_type}@ 201806L // also in \libheader{forward_list}, \libheader{list}
715715
#define @\defnlibxname{cpp_lib_logical_traits}@ 201510L // freestanding, also in \libheader{type_traits}
716716
#define @\defnlibxname{cpp_lib_make_from_tuple}@ 201606L // freestanding, also in \libheader{tuple}

0 commit comments

Comments
 (0)