summaryrefslogtreecommitdiff
path: root/AK/Vector.h
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2022-03-17 12:30:04 +0100
committerAndreas Kling <kling@serenityos.org>2022-03-18 15:18:48 +0100
commitfc6b7fcd97f5662f92864e5496d995da8f52a3e8 (patch)
tree1d2d2e0ff6208030668c598405db973271eafccc /AK/Vector.h
parentf47c92bd2e8f1b3842060c8a46387c825b196220 (diff)
downloadserenity-fc6b7fcd97f5662f92864e5496d995da8f52a3e8.zip
AK: Add const variant of Vector::in_reverse()
Diffstat (limited to 'AK/Vector.h')
-rw-r--r--AK/Vector.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/AK/Vector.h b/AK/Vector.h
index 0f6bef5179..7a4f578a3c 100644
--- a/AK/Vector.h
+++ b/AK/Vector.h
@@ -702,20 +702,28 @@ public:
using ConstIterator = SimpleIterator<Vector const, VisibleType const>;
using Iterator = SimpleIterator<Vector, VisibleType>;
using ReverseIterator = SimpleReverseIterator<Vector, VisibleType>;
+ using ReverseConstIterator = SimpleReverseIterator<Vector const, VisibleType const>;
ConstIterator begin() const { return ConstIterator::begin(*this); }
Iterator begin() { return Iterator::begin(*this); }
ReverseIterator rbegin() { return ReverseIterator::rbegin(*this); }
+ ReverseConstIterator rbegin() const { return ReverseConstIterator::rbegin(*this); }
ConstIterator end() const { return ConstIterator::end(*this); }
Iterator end() { return Iterator::end(*this); }
ReverseIterator rend() { return ReverseIterator::rend(*this); }
+ ReverseConstIterator rend() const { return ReverseConstIterator::rend(*this); }
ALWAYS_INLINE constexpr auto in_reverse()
{
return ReverseWrapper::in_reverse(*this);
}
+ ALWAYS_INLINE constexpr auto in_reverse() const
+ {
+ return ReverseWrapper::in_reverse(*this);
+ }
+
template<typename TUnaryPredicate>
ConstIterator find_if(TUnaryPredicate&& finder) const
{