summaryrefslogtreecommitdiff
path: root/AK/NonnullPtrVector.h
diff options
context:
space:
mode:
authorFederico Guerinoni <guerinoni.federico@gmail.com>2022-02-23 19:45:16 +0100
committerAndreas Kling <kling@serenityos.org>2022-03-09 17:16:28 +0100
commita54e20d958c5128603298a918d1421d24f30e1f7 (patch)
treeefce54c7cb642830dac84d6fa74199352c36d723 /AK/NonnullPtrVector.h
parentb0e74a3fd30953df972c805d46f8456e84c5024c (diff)
downloadserenity-a54e20d958c5128603298a918d1421d24f30e1f7.zip
AK: Implement ReverseIterator for NonnullPtrVector
Diffstat (limited to 'AK/NonnullPtrVector.h')
-rw-r--r--AK/NonnullPtrVector.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/AK/NonnullPtrVector.h b/AK/NonnullPtrVector.h
index 3725019115..728d37314d 100644
--- a/AK/NonnullPtrVector.h
+++ b/AK/NonnullPtrVector.h
@@ -31,12 +31,15 @@ public:
using ConstIterator = SimpleIterator<const NonnullPtrVector, const T>;
using Iterator = SimpleIterator<NonnullPtrVector, T>;
+ using ReverseIterator = SimpleReverseIterator<NonnullPtrVector, T>;
ALWAYS_INLINE constexpr ConstIterator begin() const { return ConstIterator::begin(*this); }
ALWAYS_INLINE constexpr Iterator begin() { return Iterator::begin(*this); }
+ ALWAYS_INLINE constexpr ReverseIterator rbegin() { return ReverseIterator::rbegin(*this); }
ALWAYS_INLINE constexpr ConstIterator end() const { return ConstIterator::end(*this); }
ALWAYS_INLINE constexpr Iterator end() { return Iterator::end(*this); }
+ ALWAYS_INLINE constexpr ReverseIterator rend() { return ReverseIterator::rend(*this); }
ALWAYS_INLINE PtrType& ptr_at(size_t index) { return Base::at(index); }
ALWAYS_INLINE const PtrType& ptr_at(size_t index) const { return Base::at(index); }