util/IntrusiveList: add reverse_iterator
This commit is contained in:
parent
44daa6d3e6
commit
e5680c712b
@ -412,6 +412,16 @@ public:
|
|||||||
return {&ToNode(t)};
|
return {&ToNode(t)};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
using reverse_iterator = std::reverse_iterator<iterator>;
|
||||||
|
|
||||||
|
constexpr reverse_iterator rbegin() noexcept {
|
||||||
|
return reverse_iterator{end()};
|
||||||
|
}
|
||||||
|
|
||||||
|
constexpr reverse_iterator rend() noexcept {
|
||||||
|
return reverse_iterator{begin()};
|
||||||
|
}
|
||||||
|
|
||||||
class const_iterator final {
|
class const_iterator final {
|
||||||
friend IntrusiveList;
|
friend IntrusiveList;
|
||||||
|
|
||||||
@ -487,6 +497,16 @@ public:
|
|||||||
return {&ToNode(t)};
|
return {&ToNode(t)};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
using const_reverse_iterator = std::reverse_iterator<const_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
|
* @return an iterator to the item following the specified one
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user