mirror of
https://github.com/intel/llvm.git
synced 2026-02-05 22:17:23 +08:00
[libc++] Implement ranges::is_sorted{, _until}
Reviewed By: Mordante, var-const, #libc Spies: libcxx-commits, mgorny Differential Revision: https://reviews.llvm.org/D125608
This commit is contained in:
@@ -329,6 +329,22 @@ 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<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
|
||||
|
||||
template<forward_range R, class Proj = identity,
|
||||
indirect_strict_weak_order<projected<iterator_t<R>, Proj>> Comp = ranges::less>
|
||||
constexpr bool ranges::is_sorted(R&& r, Comp comp = {}, Proj proj = {}); // 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 I ranges::is_sorted_until(I first, S last, Comp comp = {}, Proj proj = {}); // since C++20
|
||||
|
||||
template<forward_range R, class Proj = identity,
|
||||
indirect_strict_weak_order<projected<iterator_t<R>, Proj>> Comp = ranges::less>
|
||||
constexpr borrowed_iterator_t<R>
|
||||
ranges::is_sorted_until(R&& r, Comp comp = {}, Proj proj = {}); // since C++20
|
||||
}
|
||||
|
||||
constexpr bool // constexpr in C++20
|
||||
@@ -1062,6 +1078,8 @@ template <class BidirectionalIterator, class Compare>
|
||||
#include <__algorithm/ranges_for_each.h>
|
||||
#include <__algorithm/ranges_for_each_n.h>
|
||||
#include <__algorithm/ranges_is_partitioned.h>
|
||||
#include <__algorithm/ranges_is_sorted.h>
|
||||
#include <__algorithm/ranges_is_sorted_until.h>
|
||||
#include <__algorithm/ranges_max.h>
|
||||
#include <__algorithm/ranges_max_element.h>
|
||||
#include <__algorithm/ranges_min.h>
|
||||
|
||||
Reference in New Issue
Block a user