From a7e25f673986d57fc3e78131312472d7569ab688 Mon Sep 17 00:00:00 2001 From: Eisenwave Date: Sun, 14 Jun 2026 19:32:27 +0200 Subject: [PATCH] P3319R6 Add an iota object for simd (and more) --- source/numerics.tex | 25 +++++++++++++++++++++++++ source/support.tex | 2 +- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/source/numerics.tex b/source/numerics.tex index ae6be4760a..6b9dc61ba6 100644 --- a/source/numerics.tex +++ b/source/numerics.tex @@ -17020,6 +17020,8 @@ constexpr resize_t<(basic_mask::size() + ...), basic_mask> cat(const basic_mask&...) noexcept; + template constexpr T iota = @\seebelow@; + // \ref{simd.alg}, algorithms template constexpr basic_vec @@ -19785,6 +19787,29 @@ pack. \end{itemdescr} +\indexlibrarymember{iota}{simd} +\begin{itemdecl} +template constexpr T iota = @\seebelow@; +\end{itemdecl} + +\begin{itemdescr} +\pnum +\mandates +Either \tcode{T} is vectorizable and \tcode{is_arithmetic_v} is \tcode{true}, or +\begin{itemize} +\item \tcode{T} is an enabled specialization of basic_vec, +\item \tcode{is_arithmetic_v} is \tcode{true}, and +\item $\tcode{T::size() - 1} \lt \tcode{numeric_limits::max()}$. +\end{itemize} + +\pnum +\remarks +If \tcode{is_arithmetic_v} is \tcode{true}, +the value of \tcode{iota} is equal to \tcode{T()}. +Otherwise, the value of \tcode{iota} is equal to +\tcode{T([](typename T::value_type i) { return i; })}. +\end{itemdescr} + \rSec3[simd.alg]{Algorithms} \indexlibrarymember{min}{simd} diff --git a/source/support.tex b/source/support.tex index 70028e6719..9083e26a64 100644 --- a/source/support.tex +++ b/source/support.tex @@ -837,7 +837,7 @@ #define @\defnlibxname{cpp_lib_shared_ptr_weak_type}@ 201606L // also in \libheader{memory} #define @\defnlibxname{cpp_lib_shared_timed_mutex}@ 201402L // also in \libheader{shared_mutex} #define @\defnlibxname{cpp_lib_shift}@ 202202L // also in \libheader{algorithm} -#define @\defnlibxname{cpp_lib_simd}@ 202603L // also in \libheader{simd} +#define @\defnlibxname{cpp_lib_simd}@ 202606L // also in \libheader{simd} #define @\defnlibxname{cpp_lib_simd_complex}@ 202502L // also in \libheader{simd} #define @\defnlibxname{cpp_lib_simd_permutations}@ 202506L // also in \libheader{simd} #define @\defnlibxname{cpp_lib_smart_ptr_for_overwrite}@ 202002L // also in \libheader{memory}