From 175524ad02bff070225089714be669cf5e0f1ca1 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sat, 16 Sep 2023 20:47:58 +0200 Subject: [PATCH] util/IntrusiveForwardList: make end() non-static So we can have a `const` overload which is important for some algorithm templates. --- src/util/IntrusiveForwardList.hxx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/util/IntrusiveForwardList.hxx b/src/util/IntrusiveForwardList.hxx index 72b15bc1c..39055f11c 100644 --- a/src/util/IntrusiveForwardList.hxx +++ b/src/util/IntrusiveForwardList.hxx @@ -292,7 +292,7 @@ public: return {head.next}; } - static constexpr iterator end() noexcept { + constexpr iterator end() noexcept { return {nullptr}; } @@ -357,6 +357,10 @@ public: return {head.next}; } + constexpr const_iterator end() const noexcept { + return {nullptr}; + } + constexpr const_iterator last() const noexcept requires(options.cache_last) { return {last_cache.value};