diff --git a/src/util/IntrusiveList.hxx b/src/util/IntrusiveList.hxx index 2604cd6af..bed23cbf0 100644 --- a/src/util/IntrusiveList.hxx +++ b/src/util/IntrusiveList.hxx @@ -412,6 +412,16 @@ public: return {&ToNode(t)}; } + using reverse_iterator = std::reverse_iterator; + + constexpr reverse_iterator rbegin() noexcept { + return reverse_iterator{end()}; + } + + constexpr reverse_iterator rend() noexcept { + return reverse_iterator{begin()}; + } + class const_iterator final { friend IntrusiveList; @@ -487,6 +497,16 @@ public: return {&ToNode(t)}; } + using const_reverse_iterator = std::reverse_iterator; + + constexpr const_reverse_iterator rbegin() const noexcept { + return reverse_iterator{end()}; + } + + constexpr const_reverse_iterator rend() const noexcept { + return reverse_iterator{begin()}; + } + /** * @return an iterator to the item following the specified one */