From 1fa2078c49ffe0c50dd65325a578575fb7981884 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20K=C3=B6ppe?= Date: Mon, 16 Dec 2024 23:59:46 +0000 Subject: [PATCH] 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. --- source/numerics.tex | 27 +++++++++++++++++++++++---- source/support.tex | 2 +- 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/source/numerics.tex b/source/numerics.tex index d180b985ce..9d4f844781 100644 --- a/source/numerics.tex +++ b/source/numerics.tex @@ -12808,21 +12808,40 @@ \begin{itemdescr} \pnum Let \tcode{A} be +\begin{itemize} +\item \tcode{remove_cvref_t} -if \tcode{Accessor} is a specialization of \tcode{conjugated_accessor}, and -otherwise \tcode{conjugated_accessor}. +if \tcode{Accessor} is a specialization of \tcode{conjugated_accessor}; otherwise, +\item +\tcode{Accessor} if \tcode{remove_cvref_t} 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} +with overload resolution performed in a context that includes the declaration +\tcode{template conj(const T\&) = delete;}; and otherwise, +\item +\tcode{conjugated_accessor}. +\end{itemize} \pnum \returns \begin{itemize} \item -If \tcode{Accessor} is a specialization of \tcode{conjugated_accessor}, +The value \begin{codeblock} mdspan(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} 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} +with overload resolution performed in a context that includes the declaration +\tcode{template conj(const T\&) = delete;}; and otherwise, +\item +the value \begin{codeblock} mdspan(a.data_handle(), a.mapping(), conjugated_accessor(a.accessor())) diff --git a/source/support.tex b/source/support.tex index bc3e79d0a6..5d0bcb7694 100644 --- a/source/support.tex +++ b/source/support.tex @@ -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}