MCPcopy Create free account
hub / github.com/DFHack/dfhack / push_front

Method push_front

library/include/BitArray.h:590–603  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

588 }
589
590 void push_front(I *const & item)
591 {
592 auto root = static_cast<L *>(this);
593 auto link = new L();
594 link->prev = root;
595 if (root->next)
596 {
597 root->next->prev = link;
598 link->next = root->next;
599 }
600 link->item = item;
601 item->dfhack_set_list_link(link);
602 root->next = link;
603 }
604
605 static_assert(std::bidirectional_iterator<iterator>);
606 static_assert(std::bidirectional_iterator<const_iterator>);

Callers 2

TEST_FFunction · 0.80
addMethod · 0.80

Calls

no outgoing calls

Tested by 1

TEST_FFunction · 0.64