FastLED 3.9.15
Loading...
Searching...
No Matches

◆ heap_sort()

template<typename Iterator, typename Compare>
void fl::detail::heap_sort ( Iterator first,
Iterator last,
Compare comp )

Definition at line 338 of file algorithm.h.

338 {
339 heapify(first, last, comp);
340
341 Iterator end = last - 1;
342 while (end > first) {
343 swap(*end, *first);
344 sift_down(first, first, end - 1, comp);
345 --end;
346 }
347}
void sift_down(Iterator first, Iterator start, Iterator end, Compare comp)
Definition algorithm.h:300
void heapify(Iterator first, Iterator last, Compare comp)
Definition algorithm.h:325
void swap(array< T, N > &lhs, array< T, N > &rhs) noexcept(noexcept(lhs.swap(rhs)))
Definition array.h:156
constexpr T * end(T(&array)[N]) noexcept

References fl::end(), heapify(), sift_down(), and fl::swap().

+ Here is the call graph for this function: