diff --git a/src/util/IntrusiveList.hxx b/src/util/IntrusiveList.hxx index 2074220bc..84d874e47 100644 --- a/src/util/IntrusiveList.hxx +++ b/src/util/IntrusiveList.hxx @@ -207,6 +207,8 @@ class IntrusiveList { } public: + using size_type = std::size_t; + constexpr IntrusiveList() noexcept = default; IntrusiveList(IntrusiveList &&src) noexcept { @@ -255,6 +257,10 @@ public: return head.next == &head; } + constexpr size_type size() const noexcept { + return std::distance(begin(), end()); + } + void clear() noexcept { if constexpr (std::is_base_of::value) { /* for SafeLinkIntrusiveListHook, we need to