From 9fe813e572e991d3f682a72131e10c81e5b4456f Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 13 Sep 2023 13:41:38 +0200 Subject: [PATCH] util/IntrusiveForwardList: add pop_front_and_dispose() --- src/util/IntrusiveForwardList.hxx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/util/IntrusiveForwardList.hxx b/src/util/IntrusiveForwardList.hxx index a00d06050..2b792fee6 100644 --- a/src/util/IntrusiveForwardList.hxx +++ b/src/util/IntrusiveForwardList.hxx @@ -200,6 +200,11 @@ public: return i; } + void pop_front_and_dispose(Disposer auto disposer) noexcept { + auto &i = pop_front(); + disposer(&i); + } + class const_iterator; class iterator final {