Iros
 
Loading...
Searching...
No Matches
sort_heap.h
Go to the documentation of this file.
1#pragma once
2
9
10namespace di::container {
11namespace detail {
13 template<concepts::RandomAccessIterator It, concepts::SentinelFor<It> Sent, typename Comp = function::Compare,
14 typename Proj = function::Identity>
16 constexpr auto operator()(It first, Sent last, Comp comp = {}, Proj proj = {}) const -> It {
17 if (first == last) {
18 return first;
19 }
20
21 auto result = container::pop_heap(first, last, util::ref(comp), util::ref(proj));
22 for (--last; first != last; --last) {
23 container::pop_heap(first, last, util::ref(comp), util::ref(proj));
24 }
25 return result;
26 }
27
28 template<concepts::RandomAccessContainer Con, typename Comp = function::Compare,
29 typename Proj = function::Identity>
30 requires(concepts::Sortable<meta::ContainerIterator<Con>, Comp, Proj>)
31 constexpr auto operator()(Con&& container, Comp comp = {}, Proj proj = {}) const
34 }
35 };
36}
37
38constexpr inline auto sort_heap = detail::SortHeapFunction {};
39}
40
41namespace di {
43}
Definition sortable.h:11
Definition sequence.h:13
Definition sequence.h:12
constexpr auto end
Definition end.h:47
constexpr auto pop_heap
Definition pop_heap.h:83
constexpr auto sort_heap
Definition sort_heap.h:38
constexpr auto begin
Definition begin.h:44
Conditional< concepts::BorrowedContainer< Con >, ContainerIterator< Con >, container::Dangling > BorrowedIterator
Definition borrowed_iterator.h:11
constexpr auto ref
Definition reference_wrapper.h:98
Definition zstring_parser.h:9
constexpr auto proj
Definition proj.h:59