From 2151bafb507d6e4d5d6d4867d0677f51c4a10e72 Mon Sep 17 00:00:00 2001 From: Eisenwave Date: Sat, 28 Mar 2026 19:42:52 +0100 Subject: [PATCH] P4052R0 Renaming saturation arithmetic functions Fixes NB FR 026-265 (C++26 CD). --- source/algorithms.tex | 30 +++++++++++++++--------------- source/support.tex | 2 +- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/source/algorithms.tex b/source/algorithms.tex index 59d1bef3a8..af6c2c9865 100644 --- a/source/algorithms.tex +++ b/source/algorithms.tex @@ -12272,15 +12272,15 @@ // \ref{numeric.sat}, saturation arithmetic template - constexpr T add_sat(T x, T y) noexcept; + constexpr T saturating_add(T x, T y) noexcept; template - constexpr T sub_sat(T x, T y) noexcept; + constexpr T saturating_sub(T x, T y) noexcept; template - constexpr T mul_sat(T x, T y) noexcept; + constexpr T saturating_mul(T x, T y) noexcept; template - constexpr T div_sat(T x, T y) noexcept; + constexpr T saturating_div(T x, T y) noexcept; template - constexpr T saturate_cast(U x) noexcept; + constexpr T saturating_cast(U x) noexcept; } \end{codeblock} @@ -13424,10 +13424,10 @@ is performed as a mathematical operation with infinite range and then it is determined whether the mathematical result fits into the result type. -\indexlibraryglobal{add_sat}% +\indexlibraryglobal{saturating_add}% \begin{itemdecl} template - constexpr T add_sat(T x, T y) noexcept; + constexpr T saturating_add(T x, T y) noexcept; \end{itemdecl} \begin{itemdescr} @@ -13442,10 +13442,10 @@ whichever is closer to the value of $\tcode{x} + \tcode{y}$. \end{itemdescr} -\indexlibraryglobal{sub_sat}% +\indexlibraryglobal{saturating_sub}% \begin{itemdecl} template - constexpr T sub_sat(T x, T y) noexcept; + constexpr T saturating_sub(T x, T y) noexcept; \end{itemdecl} \begin{itemdescr} @@ -13460,10 +13460,10 @@ whichever is closer to the value of $\tcode{x} - \tcode{y}$. \end{itemdescr} -\indexlibraryglobal{mul_sat}% +\indexlibraryglobal{saturating_mul}% \begin{itemdecl} template - constexpr T mul_sat(T x, T y) noexcept; + constexpr T saturating_mul(T x, T y) noexcept; \end{itemdecl} \begin{itemdescr} @@ -13478,10 +13478,10 @@ whichever is closer to the value of $\tcode{x} \times \tcode{y}$. \end{itemdescr} -\indexlibraryglobal{div_sat}% +\indexlibraryglobal{saturating_div}% \begin{itemdecl} template - constexpr T div_sat(T x, T y) noexcept; + constexpr T saturating_div(T x, T y) noexcept; \end{itemdecl} \begin{itemdescr} @@ -13508,10 +13508,10 @@ \rSec3[numeric.sat.cast]{Casting} -\indexlibraryglobal{saturate_cast}% +\indexlibraryglobal{saturating_cast}% \begin{itemdecl} template - constexpr R saturate_cast(T x) noexcept; + constexpr R saturating_cast(T x) noexcept; \end{itemdecl} \begin{itemdescr} diff --git a/source/support.tex b/source/support.tex index a40172bb40..45e6b1795b 100644 --- a/source/support.tex +++ b/source/support.tex @@ -826,7 +826,7 @@ // freestanding, also in \libheader{functional}, \libheader{type_traits} #define @\defnlibxname{cpp_lib_robust_nonmodifying_seq_ops}@ 201304L // freestanding, also in \libheader{algorithm} #define @\defnlibxname{cpp_lib_sample}@ 201603L // freestanding, also in \libheader{algorithm} -#define @\defnlibxname{cpp_lib_saturation_arithmetic}@ 202311L // freestanding, also in \libheader{numeric} +#define @\defnlibxname{cpp_lib_saturation_arithmetic}@ 202603L // freestanding, also in \libheader{numeric} #define @\defnlibxname{cpp_lib_scoped_lock}@ 201703L // also in \libheader{mutex} #define @\defnlibxname{cpp_lib_semaphore}@ 201907L // also in \libheader{semaphore} #define @\defnlibxname{cpp_lib_senders}@ 202506L // also in \libheader{execution}