Skip to content

Commit

Permalink
P3050R2 Fix C++26 by optimizing linalg::conjugated for noncomplex val…
Browse files Browse the repository at this point in the history
…ue 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.
  • Loading branch information
tkoeppe committed Dec 17, 2024
1 parent 47f19eb commit 1fa2078
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 5 deletions.
27 changes: 23 additions & 4 deletions source/numerics.tex
Original file line number Diff line number Diff line change
Expand Up @@ -12808,21 +12808,40 @@
\begin{itemdescr}
\pnum
Let \tcode{A} be
\begin{itemize}
\item
\tcode{remove_cvref_t<decltype(a.accessor().nested_accessor())>}
if \tcode{Accessor} is a specialization of \tcode{conjugated_accessor}, and
otherwise \tcode{conjugated_accessor<Accessor>}.
if \tcode{Accessor} is a specialization of \tcode{conjugated_accessor}; otherwise,
\item
\tcode{Accessor} if \tcode{remove_cvref_t<ElementType>} is an arithmetic type; otherwise,
\item
\tcode{Accessor} if the expression \tcode{conj(E)} is not valid for any subexpression \tcode{E}
whose type \tcode{T} is expression-equivalent to \tcode{remove_cvref_t<ElementType>}
with overload resolution performed in a context that includes the declaration
\tcode{template<class T> conj(const T\&) = delete;}; and otherwise,
\item
\tcode{conjugated_accessor<Accessor>}.
\end{itemize}

\pnum
\returns
\begin{itemize}
\item
If \tcode{Accessor} is a specialization of \tcode{conjugated_accessor},
The value
\begin{codeblock}
mdspan<typename A::element_type, Extents, Layout, A>(a.data_handle(), a.mapping(),
a.accessor().nested_accessor())
\end{codeblock}
if \tcode{Accessor} is a specialization of \tcode{conjugated_accessor}; otherwise,
\item
otherwise,
\tcode{a} if \tcode{remove_cvref_t<ElementType>} is an arithmetic type; otherwise,
\item
\tcode{a} if the expression \tcode{conj(E)} is not valid for any subexpression \tcode{E}
whose type \tcode{T} is expression-equivalent to \tcode{remove_cvref_t<ElementType>}
with overload resolution performed in a context that includes the declaration
\tcode{template<class T> conj(const T\&) = delete;}; and otherwise,
\item
the value
\begin{codeblock}
mdspan<typename A::element_type, Extents, Layout, A>(a.data_handle(), a.mapping(),
conjugated_accessor(a.accessor()))
Expand Down
2 changes: 1 addition & 1 deletion source/support.tex
Original file line number Diff line number Diff line change
Expand Up @@ -710,7 +710,7 @@
#define @\defnlibxname{cpp_lib_jthread}@ 201911L // also in \libheader{stop_token}, \libheader{thread}
#define @\defnlibxname{cpp_lib_latch}@ 201907L // also in \libheader{latch}
#define @\defnlibxname{cpp_lib_launder}@ 201606L // freestanding, also in \libheader{new}
#define @\defnlibxname{cpp_lib_linalg}@ 202411L // also in \libheader{linalg}
#define @\defnlibxname{cpp_lib_linalg}@ 202412L // also in \libheader{linalg}
#define @\defnlibxname{cpp_lib_list_remove_return_type}@ 201806L // also in \libheader{forward_list}, \libheader{list}
#define @\defnlibxname{cpp_lib_logical_traits}@ 201510L // freestanding, also in \libheader{type_traits}
#define @\defnlibxname{cpp_lib_make_from_tuple}@ 201606L // freestanding, also in \libheader{tuple}
Expand Down

0 comments on commit 1fa2078

Please sign in to comment.