aboutsummaryrefslogtreecommitdiff
path: root/lib/libcxx/include/numeric
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2024-05-09 01:52:26 -0700
committerAndrew Kelley <andrew@ziglang.org>2024-05-09 01:52:26 -0700
commitbcb534c295d5cc6fd63caa570cc08e6b148a507c (patch)
tree0b17cb1e632d894f50f25e550d5113f232b0e877 /lib/libcxx/include/numeric
parentd9b00ee4ba48717ff6b306a6f9419e7b604ac04b (diff)
parent74f52954b9cb40d59d80b839b45bb859146731a7 (diff)
downloadzig-bcb534c295d5cc6fd63caa570cc08e6b148a507c.tar.gz
zig-bcb534c295d5cc6fd63caa570cc08e6b148a507c.zip
Merge branch 'llvm18'
Upgrades the LLVM, Clang, and LLD dependencies to LLVM 18.x Related to #16270
Diffstat (limited to 'lib/libcxx/include/numeric')
-rw-r--r--lib/libcxx/include/numeric15
1 files changed, 14 insertions, 1 deletions
diff --git a/lib/libcxx/include/numeric b/lib/libcxx/include/numeric
index 3fcf6cefdb..0fe7115f1c 100644
--- a/lib/libcxx/include/numeric
+++ b/lib/libcxx/include/numeric
@@ -140,13 +140,24 @@ template<class T>
template<class T>
constexpr T* midpoint(T* a, T* b); // C++20
+// [numeric.sat], saturation arithmetic
+template<class T>
+constexpr T add_sat(T x, T y) noexcept; // freestanding, Since C++26
+template<class T>
+constexpr T sub_sat(T x, T y) noexcept; // freestanding, Since C++26
+template<class T>
+constexpr T mul_sat(T x, T y) noexcept; // freestanding, Since C++26
+template<class T>
+constexpr T div_sat(T x, T y) noexcept; // freestanding, Since C++26
+template<class T, class U>
+constexpr T saturate_cast(U x) noexcept; // freestanding, Since C++26
+
} // std
*/
#include <__assert> // all public C++ headers provide the assertion handler
#include <__config>
-#include <cmath> // for isnormal
#include <version>
#include <__numeric/accumulate.h>
@@ -161,6 +172,7 @@ template<class T>
#include <__numeric/pstl_reduce.h>
#include <__numeric/pstl_transform_reduce.h>
#include <__numeric/reduce.h>
+#include <__numeric/saturation_arithmetic.h>
#include <__numeric/transform_exclusive_scan.h>
#include <__numeric/transform_inclusive_scan.h>
#include <__numeric/transform_reduce.h>
@@ -170,6 +182,7 @@ template<class T>
#endif
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+# include <cmath>
# include <concepts>
# include <functional>
# include <iterator>