From 454475280b626d1bda6f57780ce968e17bfd1813 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 20e520ab63..403df50c46 100644 --- a/source/algorithms.tex +++ b/source/algorithms.tex @@ -12279,15 +12279,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} @@ -13431,10 +13431,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} @@ -13449,10 +13449,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} @@ -13467,10 +13467,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} @@ -13485,10 +13485,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} @@ -13515,10 +13515,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 6d83f3e90c..b342b5558b 100644 --- a/source/support.tex +++ b/source/support.tex @@ -823,7 +823,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}