util/IntrusiveList: add missing initializer to insert_after()
We must not call std::next() if the list head was not yet initialized.
This was missing in commit 7065425927
This commit is contained in:
parent
c391adad10
commit
44f55e1866
|
@ -538,6 +538,10 @@ public:
|
||||||
* Like insert(), but insert after the given position.
|
* Like insert(), but insert after the given position.
|
||||||
*/
|
*/
|
||||||
void insert_after(iterator p, reference t) noexcept {
|
void insert_after(iterator p, reference t) noexcept {
|
||||||
|
if constexpr (options.zero_initialized)
|
||||||
|
if (head.next == nullptr)
|
||||||
|
head = {&head, &head};
|
||||||
|
|
||||||
insert(std::next(p), t);
|
insert(std::next(p), t);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue