mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-21 23:20:20 +00:00
AK: Add const variant of Vector::in_reverse()
This commit is contained in:
parent
f47c92bd2e
commit
fc6b7fcd97
Notes:
sideshowbarker
2024-07-17 20:22:04 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/fc6b7fcd97
2 changed files with 13 additions and 4 deletions
|
@ -32,19 +32,20 @@ public:
|
|||
using ConstIterator = SimpleIterator<const NonnullPtrVector, const T>;
|
||||
using Iterator = SimpleIterator<NonnullPtrVector, T>;
|
||||
using ReverseIterator = SimpleReverseIterator<NonnullPtrVector, T>;
|
||||
using ReverseConstIterator = SimpleReverseIterator<NonnullPtrVector, T const>;
|
||||
|
||||
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 ReverseConstIterator rbegin() const { return ReverseConstIterator::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 constexpr ReverseConstIterator rend() const { return ReverseConstIterator::rend(*this); }
|
||||
|
||||
ALWAYS_INLINE constexpr auto in_reverse()
|
||||
{
|
||||
return ReverseWrapper::in_reverse(*this);
|
||||
}
|
||||
ALWAYS_INLINE constexpr auto in_reverse() { return ReverseWrapper::in_reverse(*this); }
|
||||
ALWAYS_INLINE constexpr auto in_reverse() const { return ReverseWrapper::in_reverse(*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); }
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue