diff options
Diffstat (limited to 'libcxx/include/algorithm')
-rw-r--r-- | libcxx/include/algorithm | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/libcxx/include/algorithm b/libcxx/include/algorithm index 4fc353a8ce5d..7b510b5096af 100644 --- a/libcxx/include/algorithm +++ b/libcxx/include/algorithm @@ -865,6 +865,34 @@ namespace ranges { 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 } constexpr bool // constexpr in C++20 @@ -1665,6 +1693,8 @@ template <class BidirectionalIterator, class Compare> #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> |