aboutsummaryrefslogtreecommitdiff
path: root/lib/libcxx/include/algorithm
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2024-04-26 15:33:29 -0700
committerAndrew Kelley <andrew@ziglang.org>2024-05-08 19:37:29 -0700
commit06ee65af9ed6aa5ee4d1d7f4fab9d7acecf66e76 (patch)
tree1316711b92a43dd5c599e425b8693fa8e1e0c0b7 /lib/libcxx/include/algorithm
parentbc6ebc6f2597fda1f98842c6f545751fef2a5334 (diff)
downloadzig-06ee65af9ed6aa5ee4d1d7f4fab9d7acecf66e76.tar.gz
zig-06ee65af9ed6aa5ee4d1d7f4fab9d7acecf66e76.zip
libcxx: update to LLVM 18
release/18.x branch, commit 78b99c73ee4b96fe9ce0e294d4632326afb2db42 This adds the flag `-D_LIBCPP_HARDENING_MODE` which is determined based on the Zig optimization mode. This commit also fixes libunwind, libcxx, and libcxxabi to properly report sub compilation errors.
Diffstat (limited to 'lib/libcxx/include/algorithm')
-rw-r--r--lib/libcxx/include/algorithm51
1 files changed, 50 insertions, 1 deletions
diff --git a/lib/libcxx/include/algorithm b/lib/libcxx/include/algorithm
index 76e0d22bf7..1176602a2b 100644
--- a/lib/libcxx/include/algorithm
+++ b/lib/libcxx/include/algorithm
@@ -42,6 +42,9 @@ namespace ranges {
template <class I>
struct in_found_result; // since C++20
+ template <class I, class T>
+ struct in_value_result; // since C++23
+
template<forward_iterator I, sentinel_for<I> S, class Proj = identity,
indirect_strict_weak_order<projected<I, Proj>> Comp = ranges::less> // since C++20
constexpr I min_element(I first, S last, Comp comp = {}, Proj proj = {});
@@ -226,6 +229,14 @@ namespace ranges {
template<class I1, class I2>
using copy_backward_result = in_out_result<I1, I2>; // since C++20
+ template<input_iterator I, sentinel_for<I> S, class T, class Proj = identity>
+ requires indirect_binary_predicate<ranges::equal_to, projected<I, Proj>, const T*>
+ constexpr bool ranges::contains(I first, S last, const T& value, Proj proj = {}); // since C++23
+
+ template<input_range R, class T, class Proj = identity>
+ requires indirect_binary_predicate<ranges::equal_to, projected<iterator_t<R>, Proj>, const T*>
+ constexpr bool ranges::contains(R&& r, const T& value, Proj proj = {}); // since C++23
+
template<input_iterator I, sentinel_for<I> S, weakly_incrementable O>
requires indirectly_copyable<I, O>
constexpr ranges::copy_result<I, O> ranges::copy(I first, S last, O result); // since C++20
@@ -447,6 +458,22 @@ namespace ranges {
indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred>
constexpr bool ranges::any_of(R&& r, Pred pred, Proj proj = {}); // since C++20
+ template<input_iterator I1, sentinel_for<I1> S1, input_iterator I2, sentinel_for<I2> S2,
+ class Pred = ranges::equal_to, class Proj1 = identity, class Proj2 = identity>
+ requires (forward_iterator<I1> || sized_sentinel_for<S1, I1>) &&
+ (forward_iterator<I2> || sized_sentinel_for<S2, I2>) &&
+ indirectly_comparable<I1, I2, Pred, Proj1, Proj2>
+ constexpr bool ranges::ends_with(I1 first1, S1 last1, I2 first2, S2 last2, Pred pred = {},
+ Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++23
+
+ template<input_range R1, input_range R2, class Pred = ranges::equal_to, class Proj1 = identity,
+ class Proj2 = identity>
+ requires (forward_range<R1> || sized_range<R1>) &&
+ (forward_range<R2> || sized_range<R2>) &&
+ indirectly_comparable<iterator_t<R1>, iterator_t<R2>, Pred, Proj1, Proj2>
+ constexpr bool ranges::ends_with(R1&& r1, R2&& r2, Pred pred = {},
+ Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++23
+
template<input_iterator I, sentinel_for<I> S, class Proj = identity,
indirect_unary_predicate<projected<I, Proj>> Pred>
constexpr bool ranges::none_of(I first, S last, Pred pred, Proj proj = {}); // since C++20
@@ -857,6 +884,23 @@ namespace ranges {
ranges::search_n(R&& r, range_difference_t<R> count,
const T& value, Pred pred = {}, Proj proj = {}); // since C++20
+ template<input_iterator I, sentinel_for<I> S, class T,
+ indirectly-binary-left-foldable<T, I> F>
+ constexpr auto ranges::fold_left(I first, S last, T init, F f); // since C++23
+
+ template<input_range R, class T, indirectly-binary-left-foldable<T, iterator_t<R>> F>
+ constexpr auto fold_left(R&& r, T init, F f); // since C++23
+
+ template<class I, class T>
+ using fold_left_with_iter_result = in_value_result<I, T>; // since C++23
+
+ template<input_iterator I, sentinel_for<I> S, class T,
+ indirectly-binary-left-foldable<T, I> F>
+ constexpr see below fold_left_with_iter(I first, S last, T init, F f); // since C++23
+
+ template<input_range R, class T, indirectly-binary-left-foldable<T, iterator_t<R>> F>
+ constexpr see below fold_left_with_iter(R&& r, T init, F f); // since C++23
+
template<forward_iterator I1, sentinel_for<I1> S1, forward_iterator I2, sentinel_for<I2> S2,
class Pred = ranges::equal_to, class Proj1 = identity, class Proj2 = identity>
requires indirectly_comparable<I1, I2, Pred, Proj1, Proj2>
@@ -1738,7 +1782,6 @@ template <class BidirectionalIterator, class Compare>
#include <__assert> // all public C++ headers provide the assertion handler
#include <__config>
-#include <cstddef>
#include <version>
#include <__algorithm/adjacent_find.h>
@@ -1763,6 +1806,7 @@ template <class BidirectionalIterator, class Compare>
#include <__algorithm/find_first_of.h>
#include <__algorithm/find_if.h>
#include <__algorithm/find_if_not.h>
+#include <__algorithm/fold.h>
#include <__algorithm/for_each.h>
#include <__algorithm/for_each_n.h>
#include <__algorithm/generate.h>
@@ -1811,13 +1855,16 @@ template <class BidirectionalIterator, class Compare>
#include <__algorithm/pstl_any_all_none_of.h>
#include <__algorithm/pstl_copy.h>
#include <__algorithm/pstl_count.h>
+#include <__algorithm/pstl_equal.h>
#include <__algorithm/pstl_fill.h>
#include <__algorithm/pstl_find.h>
#include <__algorithm/pstl_for_each.h>
#include <__algorithm/pstl_generate.h>
#include <__algorithm/pstl_is_partitioned.h>
#include <__algorithm/pstl_merge.h>
+#include <__algorithm/pstl_move.h>
#include <__algorithm/pstl_replace.h>
+#include <__algorithm/pstl_rotate_copy.h>
#include <__algorithm/pstl_sort.h>
#include <__algorithm/pstl_stable_sort.h>
#include <__algorithm/pstl_transform.h>
@@ -1827,12 +1874,14 @@ template <class BidirectionalIterator, class Compare>
#include <__algorithm/ranges_any_of.h>
#include <__algorithm/ranges_binary_search.h>
#include <__algorithm/ranges_clamp.h>
+#include <__algorithm/ranges_contains.h>
#include <__algorithm/ranges_copy.h>
#include <__algorithm/ranges_copy_backward.h>
#include <__algorithm/ranges_copy_if.h>
#include <__algorithm/ranges_copy_n.h>
#include <__algorithm/ranges_count.h>
#include <__algorithm/ranges_count_if.h>
+#include <__algorithm/ranges_ends_with.h>
#include <__algorithm/ranges_equal.h>
#include <__algorithm/ranges_equal_range.h>
#include <__algorithm/ranges_fill.h>