MCPcopy Create free account
hub / github.com/FastLED/FastLED / rotate_impl

Function rotate_impl

src/fl/stl/algorithm.h:424–438  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

422// Rotate elements in range [first, last) so that middle becomes the new first
423template <typename Iterator>
424void rotate_impl(Iterator first, Iterator middle, Iterator last) FL_NOEXCEPT {
425 if (first == middle || middle == last) {
426 return;
427 }
428
429 Iterator next = middle;
430 while (first != next) {
431 swap(*first++, *next++);
432 if (next == last) {
433 next = middle;
434 } else if (first == middle) {
435 middle = next;
436 }
437 }
438}
439
440// Find the position where value should be inserted in sorted range [first, last)
441template <typename Iterator, typename T, typename Compare>

Callers 1

merge_inplaceFunction · 0.85

Calls 1

swapFunction · 0.70

Tested by

no test coverage detected