diff options
author | AlexSm <alex@ydb.tech> | 2024-01-18 11:28:56 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-18 11:28:56 +0100 |
commit | 9d0a3761b3201e0d9db879a7adf91876ebdb0564 (patch) | |
tree | 541d11ac878c18efd7ebca81e35112aa0fef995b /contrib/libs/cxxsupp/libcxx/include/algorithm | |
parent | 404ef8886ecc9736bc58ade6da2fbd83b486a408 (diff) | |
download | ydb-9d0a3761b3201e0d9db879a7adf91876ebdb0564.tar.gz |
Library import 8 (#1074)
* Library import 8
* Add contrib/libs/cxxsupp/libcxx/include/__verbose_abort
Diffstat (limited to 'contrib/libs/cxxsupp/libcxx/include/algorithm')
-rw-r--r-- | contrib/libs/cxxsupp/libcxx/include/algorithm | 282 |
1 files changed, 282 insertions, 0 deletions
diff --git a/contrib/libs/cxxsupp/libcxx/include/algorithm b/contrib/libs/cxxsupp/libcxx/include/algorithm index e972a34d06..a2a8a27ddd 100644 --- a/contrib/libs/cxxsupp/libcxx/include/algorithm +++ b/contrib/libs/cxxsupp/libcxx/include/algorithm @@ -331,6 +331,23 @@ namespace ranges { constexpr borrowed_iterator_t<R> ranges::sort_heap(R&& r, Comp comp = {}, Proj proj = {}); // since C++20 + template<random_access_iterator I, sentinel_for<I> S, class Proj = identity, + indirect_strict_weak_order<projected<I, Proj>> Comp = ranges::less> + constexpr bool is_heap(I first, S last, Comp comp = {}, Proj proj = {}); // Since C++20 + + template<random_access_range R, class Proj = identity, + indirect_strict_weak_order<projected<iterator_t<R>, Proj>> Comp = ranges::less> + constexpr bool is_heap(R&& r, Comp comp = {}, Proj proj = {}); // Since C++20 + + template<random_access_iterator I, sentinel_for<I> S, class Proj = identity, + indirect_strict_weak_order<projected<I, Proj>> Comp = ranges::less> + constexpr I is_heap_until(I first, S last, Comp comp = {}, Proj proj = {}); // Since C++20 + + template<random_access_range R, class Proj = identity, + indirect_strict_weak_order<projected<iterator_t<R>, Proj>> Comp = ranges::less> + constexpr borrowed_iterator_t<R> + is_heap_until(R&& r, Comp comp = {}, Proj proj = {}); // Since C++20 + template<bidirectional_iterator I, sentinel_for<I> S> requires permutable<I> constexpr I ranges::reverse(I first, S last); // since C++20 @@ -380,6 +397,18 @@ namespace ranges { template<class T, output_iterator<const T&> O> constexpr O ranges::fill_n(O first, iter_difference_t<O> n, const T& value); // since C++20 + template<input_or_output_iterator O, sentinel_for<O> S, copy_constructible F> + requires invocable<F&> && indirectly_writable<O, invoke_result_t<F&>> + constexpr O generate(O first, S last, F gen); // Since C++20 + + template<class R, copy_constructible F> + requires invocable<F&> && output_range<R, invoke_result_t<F&>> + constexpr borrowed_iterator_t<R> generate(R&& r, F gen); // Since C++20 + + template<input_or_output_iterator O, copy_constructible F> + requires invocable<F&> && indirectly_writable<O, invoke_result_t<F&>> + constexpr O generate_n(O first, iter_difference_t<O> n, F gen); // 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 indirectly_comparable<I1, I2, Pred, Proj1, Proj2> @@ -417,6 +446,25 @@ namespace ranges { indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred> constexpr bool ranges::none_of(R&& r, Pred pred, Proj proj = {}); // since C++20 + template<input_iterator I1, sentinel_for<I1> S1, + random_access_iterator I2, sentinel_for<I2> S2, + class Comp = ranges::less, class Proj1 = identity, class Proj2 = identity> + requires indirectly_copyable<I1, I2> && sortable<I2, Comp, Proj2> && + indirect_strict_weak_order<Comp, projected<I1, Proj1>, projected<I2, Proj2>> + constexpr partial_sort_copy_result<I1, I2> + partial_sort_copy(I1 first, S1 last, I2 result_first, S2 result_last, + Comp comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); // Since C++20 + + template<input_range R1, random_access_range R2, class Comp = ranges::less, + class Proj1 = identity, class Proj2 = identity> + requires indirectly_copyable<iterator_t<R1>, iterator_t<R2>> && + sortable<iterator_t<R2>, Comp, Proj2> && + indirect_strict_weak_order<Comp, projected<iterator_t<R1>, Proj1>, + projected<iterator_t<R2>, Proj2>> + constexpr partial_sort_copy_result<borrowed_iterator_t<R1>, borrowed_iterator_t<R2>> + partial_sort_copy(R1&& r, R2&& result_r, Comp comp = {}, + Proj1 proj1 = {}, Proj2 proj2 = {}); // Since C++20 + template<forward_iterator I, sentinel_for<I> S, class Proj = identity, indirect_strict_weak_order<projected<I, Proj>> Comp = ranges::less> constexpr bool ranges::is_sorted(I first, S last, Comp comp = {}, Proj proj = {}); // since C++20 @@ -545,6 +593,11 @@ namespace ranges { constexpr borrowed_iterator_t<R> ranges::replace_if(R&& r, Pred pred, const T& new_value, Proj proj = {}); // since C++20 + template<class T, class Proj = identity, + indirect_strict_weak_order<projected<const T*, Proj>> Comp = ranges::less> + constexpr const T& + ranges::clamp(const T& v, const T& lo, const T& hi, Comp comp = {}, Proj proj = {}); // since C++20 + template<input_iterator I1, sentinel_for<I1> S1, input_iterator I2, sentinel_for<I2> S2, class Proj1 = identity, class Proj2 = identity, indirect_strict_weak_order<projected<I1, Proj1>, @@ -697,6 +750,13 @@ namespace ranges { constexpr ranges::reverse_copy_result<borrowed_iterator_t<R>, O> ranges::reverse_copy(R&& r, O result); // since C++20 + template<permutable I, sentinel_for<I> S> + constexpr subrange<I> rotate(I first, I middle, S last); // since C++20 + + template<forward_range R> + requires permutable<iterator_t<R>> + constexpr borrowed_subrange_t<R> rotate(R&& r, iterator_t<R> middle); // Since C++20 + template <class _InIter, class _OutIter> using rotate_copy_result = in_out_result<_InIter, _OutIter>; // since C++20 @@ -710,6 +770,43 @@ namespace ranges { constexpr ranges::rotate_copy_result<borrowed_iterator_t<R>, O> ranges::rotate_copy(R&& r, iterator_t<R> middle, O result); // since C++20 + template<input_iterator I, sentinel_for<I> S, weakly_incrementable O, class Gen> + requires (forward_iterator<I> || random_access_iterator<O>) && + indirectly_copyable<I, O> && + uniform_random_bit_generator<remove_reference_t<Gen>> + O sample(I first, S last, O out, iter_difference_t<I> n, Gen&& g); // Since C++20 + + template<input_range R, weakly_incrementable O, class Gen> + requires (forward_range<R> || random_access_iterator<O>) && + indirectly_copyable<iterator_t<R>, O> && + uniform_random_bit_generator<remove_reference_t<Gen>> + O sample(R&& r, O out, range_difference_t<R> n, Gen&& g); // Since C++20 + + template<random_access_iterator I, sentinel_for<I> S, class Gen> + requires permutable<I> && + uniform_random_bit_generator<remove_reference_t<Gen>> + I shuffle(I first, S last, Gen&& g); // Since C++20 + + template<random_access_range R, class Gen> + requires permutable<iterator_t<R>> && + uniform_random_bit_generator<remove_reference_t<Gen>> + borrowed_iterator_t<R> shuffle(R&& r, Gen&& g); // Since C++20 + + template<forward_iterator I1, sentinel_for<I1> S1, forward_iterator I2, + sentinel_for<I2> S2, class Proj1 = identity, class Proj2 = identity, + indirect_equivalence_relation<projected<I1, Proj1>, + projected<I2, Proj2>> Pred = ranges::equal_to> + constexpr bool ranges::is_permutation(I1 first1, S1 last1, I2 first2, S2 last2, + Pred pred = {}, + Proj1 proj1 = {}, Proj2 proj2 = {}); // Since C++20 + + template<forward_range R1, forward_range R2, + class Proj1 = identity, class Proj2 = identity, + indirect_equivalence_relation<projected<iterator_t<R1>, Proj1>, + projected<iterator_t<R2>, Proj2>> Pred = ranges::equal_to> + constexpr bool ranges::is_permutation(R1&& r1, R2&& r2, Pred pred = {}, + Proj1 proj1 = {}, Proj2 proj2 = {}); // Since C++20 + 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> @@ -773,6 +870,17 @@ namespace ranges { set_symmetric_difference(R1&& r1, R2&& r2, O result, Comp comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20 + template<forward_iterator I, sentinel_for<I> S, class T, class Proj = identity, + indirect_strict_weak_order<const T*, projected<I, Proj>> Comp = ranges::less> + constexpr subrange<I> + equal_range(I first, S last, const T& value, Comp comp = {}, Proj proj = {}); // since C++20 + + template<forward_range R, class T, class Proj = identity, + indirect_strict_weak_order<const T*, projected<iterator_t<R>, Proj>> Comp = + ranges::less> + constexpr borrowed_subrange_t<R> + equal_range(R&& r, const T& value, Comp comp = {}, Proj proj = {}); // since C++20 + template<class I1, class I2, class O> using set_union_result = in_in_out_result<I1, I2, O>; // since C++20 @@ -790,8 +898,161 @@ namespace ranges { constexpr set_union_result<borrowed_iterator_t<R1>, borrowed_iterator_t<R2>, O> set_union(R1&& r1, R2&& r2, O result, Comp comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20 + + template<input_iterator I1, sentinel_for<I1> S1, input_iterator I2, sentinel_for<I2> S2, + class Proj1 = identity, class Proj2 = identity, + indirect_strict_weak_order<projected<I1, Proj1>, projected<I2, Proj2>> Comp = + ranges::less> + constexpr bool includes(I1 first1, S1 last1, I2 first2, S2 last2, Comp comp = {}, + Proj1 proj1 = {}, Proj2 proj2 = {}); // Since C++20 + + template<input_range R1, input_range R2, class Proj1 = identity, + class Proj2 = identity, + indirect_strict_weak_order<projected<iterator_t<R1>, Proj1>, + projected<iterator_t<R2>, Proj2>> Comp = ranges::less> + constexpr bool includes(R1&& r1, R2&& r2, Comp comp = {}, + Proj1 proj1 = {}, Proj2 proj2 = {}); // Since C++20 + + template<bidirectional_iterator I, sentinel_for<I> S, class Comp = ranges::less, + class Proj = identity> + requires sortable<I, Comp, Proj> + I inplace_merge(I first, I middle, S last, Comp comp = {}, Proj proj = {}); // Since C++20 + + template<bidirectional_range R, class Comp = ranges::less, class Proj = identity> + requires sortable<iterator_t<R>, Comp, Proj> + borrowed_iterator_t<R> + inplace_merge(R&& r, iterator_t<R> middle, Comp comp = {}, + Proj proj = {}); // Since C++20 + + template<permutable I, sentinel_for<I> S, class Proj = identity, + indirect_equivalence_relation<projected<I, Proj>> C = ranges::equal_to> + constexpr subrange<I> unique(I first, S last, C comp = {}, Proj proj = {}); // Since C++20 + + template<forward_range R, class Proj = identity, + indirect_equivalence_relation<projected<iterator_t<R>, Proj>> C = ranges::equal_to> + requires permutable<iterator_t<R>> + constexpr borrowed_subrange_t<R> + unique(R&& r, C comp = {}, Proj proj = {}); // Since C++20 + + template<input_iterator I, sentinel_for<I> S, weakly_incrementable O, class Proj = identity, + indirect_equivalence_relation<projected<I, Proj>> C = ranges::equal_to> + requires indirectly_copyable<I, O> && + (forward_iterator<I> || + (input_iterator<O> && same_as<iter_value_t<I>, iter_value_t<O>>) || + indirectly_copyable_storable<I, O>) + constexpr unique_copy_result<I, O> + unique_copy(I first, S last, O result, C comp = {}, Proj proj = {}); // Since C++20 + + template<input_range R, weakly_incrementable O, class Proj = identity, + indirect_equivalence_relation<projected<iterator_t<R>, Proj>> C = ranges::equal_to> + requires indirectly_copyable<iterator_t<R>, O> && + (forward_iterator<iterator_t<R>> || + (input_iterator<O> && same_as<range_value_t<R>, iter_value_t<O>>) || + indirectly_copyable_storable<iterator_t<R>, O>) + constexpr unique_copy_result<borrowed_iterator_t<R>, O> + unique_copy(R&& r, O result, C comp = {}, Proj proj = {}); // Since C++20 + + template<class I, class O> + using remove_copy_result = in_out_result<I, O>; // Since C++20 + + template<input_iterator I, sentinel_for<I> S, weakly_incrementable O, class T, + class Proj = identity> + indirect_binary_predicate<ranges::equal_to, projected<I, Proj>, const T*> + constexpr remove_copy_result<I, O> + remove_copy(I first, S last, O result, const T& value, Proj proj = {}); // Since C++20 + + template<input_range R, weakly_incrementable O, class T, class Proj = identity> + requires indirectly_copyable<iterator_t<R>, O> && + indirect_binary_predicate<ranges::equal_to, + projected<iterator_t<R>, Proj>, const T*> + constexpr remove_copy_result<borrowed_iterator_t<R>, O> + remove_copy(R&& r, O result, const T& value, Proj proj = {}); // Since C++20 + + template<class I, class O> + using remove_copy_if_result = in_out_result<I, O>; // Since C++20 + + template<input_iterator I, sentinel_for<I> S, weakly_incrementable O, + class Proj = identity, indirect_unary_predicate<projected<I, Proj>> Pred> + requires indirectly_copyable<I, O> + constexpr remove_copy_if_result<I, O> + remove_copy_if(I first, S last, O result, Pred pred, Proj proj = {}); // Since C++20 + + template<input_range R, weakly_incrementable O, class Proj = identity, + indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred> + requires indirectly_copyable<iterator_t<R>, O> + constexpr remove_copy_if_result<borrowed_iterator_t<R>, O> + remove_copy_if(R&& r, O result, Pred pred, Proj proj = {}); // Since C++20 + + template<class I, class O> + using replace_copy_result = in_out_result<I, O>; // Since C++20 + + template<input_iterator I, sentinel_for<I> S, class T1, class T2, + output_iterator<const T2&> O, class Proj = identity> + requires indirectly_copyable<I, O> && + indirect_binary_predicate<ranges::equal_to, projected<I, Proj>, const T1*> + constexpr replace_copy_result<I, O> + replace_copy(I first, S last, O result, const T1& old_value, const T2& new_value, + Proj proj = {}); // Since C++20 + + template<input_range R, class T1, class T2, output_iterator<const T2&> O, + class Proj = identity> + requires indirectly_copyable<iterator_t<R>, O> && + indirect_binary_predicate<ranges::equal_to, + projected<iterator_t<R>, Proj>, const T1*> + constexpr replace_copy_result<borrowed_iterator_t<R>, O> + replace_copy(R&& r, O result, const T1& old_value, const T2& new_value, + Proj proj = {}); // Since C++20 + + template<class I, class O> + using replace_copy_if_result = in_out_result<I, O>; // Since C++20 + + template<input_iterator I, sentinel_for<I> S, class T, output_iterator<const T&> O, + class Proj = identity, indirect_unary_predicate<projected<I, Proj>> Pred> + requires indirectly_copyable<I, O> + constexpr replace_copy_if_result<I, O> + replace_copy_if(I first, S last, O result, Pred pred, const T& new_value, + Proj proj = {}); // Since C++20 + + template<input_range R, class T, output_iterator<const T&> O, class Proj = identity, + indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred> + requires indirectly_copyable<iterator_t<R>, O> + constexpr replace_copy_if_result<borrowed_iterator_t<R>, O> + replace_copy_if(R&& r, O result, Pred pred, const T& new_value, + Proj proj = {}); // Since C++20 + + template<class I> + using prev_permutation_result = in_found_result<I>; // Since C++20 + + template<bidirectional_iterator I, sentinel_for<I> S, class Comp = ranges::less, + class Proj = identity> + requires sortable<I, Comp, Proj> + constexpr ranges::prev_permutation_result<I> + ranges::prev_permutation(I first, S last, Comp comp = {}, Proj proj = {}); // Since C++20 + + template<bidirectional_range R, class Comp = ranges::less, + class Proj = identity> + requires sortable<iterator_t<R>, Comp, Proj> + constexpr ranges::prev_permutation_result<borrowed_iterator_t<R>> + ranges::prev_permutation(R&& r, Comp comp = {}, Proj proj = {}); // Since C++20 + + template<class I> + using next_permutation_result = in_found_result<I>; // Since C++20 + + template<bidirectional_iterator I, sentinel_for<I> S, class Comp = ranges::less, + class Proj = identity> + requires sortable<I, Comp, Proj> + constexpr ranges::next_permutation_result<I> + ranges::next_permutation(I first, S last, Comp comp = {}, Proj proj = {}); // Since C++20 + + template<bidirectional_range R, class Comp = ranges::less, + class Proj = identity> + requires sortable<iterator_t<R>, Comp, Proj> + constexpr ranges::next_permutation_result<borrowed_iterator_t<R>> + ranges::next_permutation(R&& r, Comp comp = {}, Proj proj = {}); // Since C++20 + } +template <class InputIterator, class Predicate> constexpr bool // constexpr in C++20 all_of(InputIterator first, InputIterator last, Predicate pred); @@ -1523,6 +1784,7 @@ template <class BidirectionalIterator, class Compare> #include <__algorithm/ranges_all_of.h> #include <__algorithm/ranges_any_of.h> #include <__algorithm/ranges_binary_search.h> +#include <__algorithm/ranges_clamp.h> #include <__algorithm/ranges_copy.h> #include <__algorithm/ranges_copy_backward.h> #include <__algorithm/ranges_copy_if.h> @@ -1530,6 +1792,7 @@ template <class BidirectionalIterator, class Compare> #include <__algorithm/ranges_count.h> #include <__algorithm/ranges_count_if.h> #include <__algorithm/ranges_equal.h> +#include <__algorithm/ranges_equal_range.h> #include <__algorithm/ranges_fill.h> #include <__algorithm/ranges_fill_n.h> #include <__algorithm/ranges_find.h> @@ -1539,7 +1802,14 @@ template <class BidirectionalIterator, class Compare> #include <__algorithm/ranges_find_if_not.h> #include <__algorithm/ranges_for_each.h> #include <__algorithm/ranges_for_each_n.h> +#include <__algorithm/ranges_generate.h> +#include <__algorithm/ranges_generate_n.h> +#include <__algorithm/ranges_includes.h> +#include <__algorithm/ranges_inplace_merge.h> +#include <__algorithm/ranges_is_heap.h> +#include <__algorithm/ranges_is_heap_until.h> #include <__algorithm/ranges_is_partitioned.h> +#include <__algorithm/ranges_is_permutation.h> #include <__algorithm/ranges_is_sorted.h> #include <__algorithm/ranges_is_sorted_until.h> #include <__algorithm/ranges_lexicographical_compare.h> @@ -1555,33 +1825,45 @@ template <class BidirectionalIterator, class Compare> #include <__algorithm/ranges_mismatch.h> #include <__algorithm/ranges_move.h> #include <__algorithm/ranges_move_backward.h> +#include <__algorithm/ranges_next_permutation.h> #include <__algorithm/ranges_none_of.h> #include <__algorithm/ranges_nth_element.h> #include <__algorithm/ranges_partial_sort.h> +#include <__algorithm/ranges_partial_sort_copy.h> #include <__algorithm/ranges_partition.h> #include <__algorithm/ranges_partition_copy.h> #include <__algorithm/ranges_partition_point.h> #include <__algorithm/ranges_pop_heap.h> +#include <__algorithm/ranges_prev_permutation.h> #include <__algorithm/ranges_push_heap.h> #include <__algorithm/ranges_remove.h> +#include <__algorithm/ranges_remove_copy.h> +#include <__algorithm/ranges_remove_copy_if.h> #include <__algorithm/ranges_remove_if.h> #include <__algorithm/ranges_replace.h> +#include <__algorithm/ranges_replace_copy.h> +#include <__algorithm/ranges_replace_copy_if.h> #include <__algorithm/ranges_replace_if.h> #include <__algorithm/ranges_reverse.h> #include <__algorithm/ranges_reverse_copy.h> +#include <__algorithm/ranges_rotate.h> #include <__algorithm/ranges_rotate_copy.h> +#include <__algorithm/ranges_sample.h> #include <__algorithm/ranges_search.h> #include <__algorithm/ranges_search_n.h> #include <__algorithm/ranges_set_difference.h> #include <__algorithm/ranges_set_intersection.h> #include <__algorithm/ranges_set_symmetric_difference.h> #include <__algorithm/ranges_set_union.h> +#include <__algorithm/ranges_shuffle.h> #include <__algorithm/ranges_sort.h> #include <__algorithm/ranges_sort_heap.h> #include <__algorithm/ranges_stable_partition.h> #include <__algorithm/ranges_stable_sort.h> #include <__algorithm/ranges_swap_ranges.h> #include <__algorithm/ranges_transform.h> +#include <__algorithm/ranges_unique.h> +#include <__algorithm/ranges_unique_copy.h> #include <__algorithm/ranges_upper_bound.h> #include <__algorithm/remove.h> #include <__algorithm/remove_copy.h> |