mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1127045 part 3 - Make nsTArray support reverse iterating. r=froydnj
This commit is contained in:
parent
e7e326d1e6
commit
1aa524cf40
@ -14,6 +14,7 @@
|
||||
#include "mozilla/MathAlgorithms.h"
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/Move.h"
|
||||
#include "mozilla/ReverseIterator.h"
|
||||
#include "mozilla/TypeTraits.h"
|
||||
|
||||
#include <string.h>
|
||||
@ -770,6 +771,8 @@ public:
|
||||
typedef nsTArray_SafeElementAtHelper<E, self_type> safeelementat_helper_type;
|
||||
typedef elem_type* iterator;
|
||||
typedef const elem_type* const_iterator;
|
||||
typedef mozilla::ReverseIterator<elem_type*> reverse_iterator;
|
||||
typedef mozilla::ReverseIterator<const elem_type*> const_reverse_iterator;
|
||||
|
||||
using safeelementat_helper_type::SafeElementAt;
|
||||
using base_type::EmptyHdr;
|
||||
@ -1001,6 +1004,14 @@ public:
|
||||
const_iterator end() const { return Elements() + Length(); }
|
||||
const_iterator cend() const { return end(); }
|
||||
|
||||
// Methods for reverse iterating.
|
||||
reverse_iterator rbegin() { return reverse_iterator(end()); }
|
||||
const_reverse_iterator rbegin() const { return const_reverse_iterator(end()); }
|
||||
const_reverse_iterator crbegin() const { return rbegin(); }
|
||||
reverse_iterator rend() { return reverse_iterator(begin()); }
|
||||
const_reverse_iterator rend() const { return const_reverse_iterator(begin()); }
|
||||
const_reverse_iterator crend() const { return rend(); }
|
||||
|
||||
//
|
||||
// Search methods
|
||||
//
|
||||
|
Loading…
Reference in New Issue
Block a user