diff options
author | Nikolas Klauser <nikolasklauser@berlin.de> | 2022-05-24 10:32:50 +0200 |
---|---|---|
committer | Nikolas Klauser <nikolasklauser@berlin.de> | 2022-05-24 10:33:57 +0200 |
commit | 1d1a191edcfa87bf77331ffcc8fa29562b17f517 (patch) | |
tree | 962e8e46131deaf544b60e450cab437e977c92d4 /libcxx/include/algorithm | |
parent | b07880454ba32e48a2e7f7be35516e0b76f60077 (diff) | |
download | llvm-1d1a191edcfa87bf77331ffcc8fa29562b17f517.zip llvm-1d1a191edcfa87bf77331ffcc8fa29562b17f517.tar.gz llvm-1d1a191edcfa87bf77331ffcc8fa29562b17f517.tar.bz2 |
[libc++] Implement ranges::reverse
Reviewed By: var-const, #libc
Spies: libcxx-commits, mgorny
Differential Revision: https://reviews.llvm.org/D125752
Diffstat (limited to 'libcxx/include/algorithm')
-rw-r--r-- | libcxx/include/algorithm | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/libcxx/include/algorithm b/libcxx/include/algorithm index a95fa76..224c9e1 100644 --- a/libcxx/include/algorithm +++ b/libcxx/include/algorithm @@ -274,6 +274,15 @@ namespace ranges { indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred> constexpr bool ranges::is_partitioned(R&& r, Pred pred, 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 + + template<bidirectional_range R> + requires permutable<iterator_t<R>> + constexpr borrowed_iterator_t<R> ranges::reverse(R&& r); // since C++20 + } constexpr bool // constexpr in C++20 @@ -1009,6 +1018,7 @@ template <class BidirectionalIterator, class Compare> #include <__algorithm/ranges_minmax.h> #include <__algorithm/ranges_minmax_element.h> #include <__algorithm/ranges_mismatch.h> +#include <__algorithm/ranges_reverse.h> #include <__algorithm/ranges_swap_ranges.h> #include <__algorithm/ranges_transform.h> #include <__algorithm/remove.h> |