util/IntrusiveForwardList: add non-static insert_after() implementation
This commit is contained in:
parent
df7ed27b78
commit
5c44082b77
@ -317,9 +317,10 @@ public:
|
|||||||
++counter;
|
++counter;
|
||||||
}
|
}
|
||||||
|
|
||||||
static iterator insert_after(iterator pos, reference t) noexcept {
|
static iterator insert_after(iterator pos, reference t) noexcept
|
||||||
// no counter update in this static method
|
requires(!constant_time_size) {
|
||||||
static_assert(!constant_time_size);
|
/* if we have no counter, then this method is allowed
|
||||||
|
to be static */
|
||||||
|
|
||||||
auto &pos_node = *pos.cursor;
|
auto &pos_node = *pos.cursor;
|
||||||
auto &new_node = ToNode(t);
|
auto &new_node = ToNode(t);
|
||||||
@ -328,6 +329,15 @@ public:
|
|||||||
return &new_node;
|
return &new_node;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
iterator insert_after(iterator pos, reference t) noexcept {
|
||||||
|
auto &pos_node = *pos.cursor;
|
||||||
|
auto &new_node = ToNode(t);
|
||||||
|
new_node.next = pos_node.next;
|
||||||
|
pos_node.next = &new_node;
|
||||||
|
++counter;
|
||||||
|
return &new_node;
|
||||||
|
}
|
||||||
|
|
||||||
void erase_after(iterator pos) noexcept {
|
void erase_after(iterator pos) noexcept {
|
||||||
pos.cursor->next = pos.cursor->next->next;
|
pos.cursor->next = pos.cursor->next->next;
|
||||||
--counter;
|
--counter;
|
||||||
|
Loading…
Reference in New Issue
Block a user