util/IntrusiveList: add single-item splice() overload

This commit is contained in:
Max Kellermann 2022-11-11 17:37:31 +01:00
parent df15c418c7
commit 60e640af5a

View File

@ -535,6 +535,17 @@ public:
++counter;
}
/**
* Move one item of the given list to this one before the
* given position.
*/
void splice(iterator position,
IntrusiveList &from, iterator i) noexcept {
auto &item = *i;
from.erase(i);
insert(position, item);
}
/**
* Move the given range of items of the given list to this one
* before the given position.