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

Method insert_after

library/include/BitArray.h:569–588  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

567 }
568
569 iterator insert_after(const_iterator pos, I *const & item)
570 {
571 auto root = static_cast<L *>(this);
572 CHECK_INVALID_ARGUMENT(pos.iter.root == root);
573 CHECK_INVALID_ARGUMENT(pos.iter.cur);
574
575 auto link = pos.iter.cur;
576 auto next = link->next;
577 auto newlink = new L();
578 newlink->prev = link;
579 newlink->next = next;
580 link->next = newlink;
581 if (next)
582 {
583 next->prev = newlink;
584 }
585 newlink->item = item;
586 item->dfhack_set_list_link(newlink);
587 return iterator(root, newlink);
588 }
589
590 void push_front(I *const & item)
591 {

Callers 1

TEST_FFunction · 0.80

Calls 1

iteratorClass · 0.85

Tested by 1

TEST_FFunction · 0.64