From b0da0bbf8b981d739d8e83fa9b51eccf0d1b2bca Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 13 Sep 2023 13:40:33 +0200 Subject: [PATCH] util/IntrusiveForwardList: pop_front() returns reference --- src/util/IntrusiveForwardList.hxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/util/IntrusiveForwardList.hxx b/src/util/IntrusiveForwardList.hxx index 5bd643c7f..a00d06050 100644 --- a/src/util/IntrusiveForwardList.hxx +++ b/src/util/IntrusiveForwardList.hxx @@ -193,9 +193,11 @@ public: return *Cast(head.next); } - void pop_front() noexcept { + reference pop_front() noexcept { + auto &i = front(); head.next = head.next->next; --counter; + return i; } class const_iterator;