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

◆ insertion_sort()

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

Definition at line 298 of file algorithm.h.

298 {
299 if (first == last) return;
300
301 for (Iterator i = first + 1; i != last; ++i) {
302 auto value = fl::move(*i);
303 Iterator j = i;
304
305 while (j != first && comp(value, *(j - 1))) {
306 *j = fl::move(*(j - 1));
307 --j;
308 }
309
310 *j = fl::move(value);
311 }
312}
constexpr remove_reference< T >::type && move(T &&t) FL_NOEXCEPT
Definition s16x16x4.h:28
constexpr int type_rank< T >::value

References FL_NOEXCEPT, fl::fl::move(), and fl::type_rank< T >::value.

Referenced by mergesort_impl(), quicksort_impl(), and fl::sort_small().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: