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

Function push_heap

src/fl/stl/priority_queue.h:38–50  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36
37template <typename Iterator, typename Compare>
38void push_heap(Iterator first, Iterator last, Compare comp) {
39 auto pos = last - 1;
40 auto parent = first + ((pos - first) - 1) / 2;
41
42 while (pos > first && comp(*parent, *pos)) {
43 auto tmp = *parent;
44 *parent = *pos;
45 *pos = tmp;
46
47 pos = parent;
48 parent = first + ((pos - first) - 1) / 2;
49 }
50}
51
52template <typename Iterator> void push_heap(Iterator first, Iterator last) {
53 using value_type = typename fl::remove_reference<decltype(*first)>::type;

Callers 3

pushMethod · 0.85
emplaceMethod · 0.85
FL_TEST_FILEFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected