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 398 of file algorithm.h.

398 {
399 heapify(first, last, comp);
400
401 Iterator end = last - 1;
402 while (end > first) {
403 swap(*end, *first);
404 sift_down(first, first, end - 1, comp);
405 --end;
406 }
407}
void heapify(Iterator first, Iterator last, Compare comp) FL_NOEXCEPT
Definition algorithm.h:385
void sift_down(Iterator first, Iterator start, Iterator end, Compare comp) FL_NOEXCEPT
Definition algorithm.h:360
constexpr T * end(T(&array)[N]) FL_NOEXCEPT
void swap(array< T, N > &lhs, array< T, N > &rhs) FL_NOEXCEPT
Definition array.h:209

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

+ Here is the call graph for this function: