FastLED 3.10.8
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 303 of file algorithm.h.

303 {
304 if (first == last) return;
305
306 for (Iterator i = first + 1; i != last; ++i) {
307 auto value = fl::move(*i);
308 Iterator j = i;
309
310 while (j != first && comp(value, *(j - 1))) {
311 *j = fl::move(*(j - 1));
312 --j;
313 }
314
315 *j = fl::move(value);
316 }
317}
constexpr remove_reference< T >::type && move(T &&t) FL_NO_EXCEPT
Definition s16x16x4.h:30
constexpr int type_rank< T >::value

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

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

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