const_list: added linking of other linked nodes in const_list_node::push_before

This commit is contained in:
cyborg1811m 2024-02-06 22:22:07 +01:00
parent af7a6baaf9
commit 5cda16f846
1 changed files with 3 additions and 4 deletions

View File

@ -454,8 +454,6 @@ namespace cc {
first2 = next; first2 = next;
} }
other._tail._next = &other._tail;
other._tail._prev = &other._tail;
other._size = 0; other._size = 0;
} }
@ -490,8 +488,6 @@ namespace cc {
first2 = next; first2 = next;
} }
other._tail._next = &other._tail;
other._tail._prev = &other._tail;
other._size = 0; other._size = 0;
} }
@ -569,6 +565,9 @@ namespace cc {
template<typename D> template<typename D>
constexpr void const_list_node<D>::push_before(const_list_node *node) noexcept constexpr void const_list_node<D>::push_before(const_list_node *node) noexcept
{ {
node->_prev->_next = node->_next;
node->_next->_prev = node->_prev;
node->_prev = _prev; node->_prev = _prev;
node->_next = this; node->_next = this;