mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1126552 part 1 - Make nsTArray support range-based for loops. r=froydnj
This commit is contained in:
parent
3f8ebecfd2
commit
901d25c409
@ -768,6 +768,8 @@ public:
|
|||||||
typedef nsTArray_Impl<E, Alloc> self_type;
|
typedef nsTArray_Impl<E, Alloc> self_type;
|
||||||
typedef nsTArrayElementTraits<E> elem_traits;
|
typedef nsTArrayElementTraits<E> elem_traits;
|
||||||
typedef nsTArray_SafeElementAtHelper<E, self_type> safeelementat_helper_type;
|
typedef nsTArray_SafeElementAtHelper<E, self_type> safeelementat_helper_type;
|
||||||
|
typedef elem_type* iterator;
|
||||||
|
typedef const elem_type* const_iterator;
|
||||||
|
|
||||||
using safeelementat_helper_type::SafeElementAt;
|
using safeelementat_helper_type::SafeElementAt;
|
||||||
using base_type::EmptyHdr;
|
using base_type::EmptyHdr;
|
||||||
@ -991,6 +993,14 @@ public:
|
|||||||
return SafeElementAt(Length() - 1, aDef);
|
return SafeElementAt(Length() - 1, aDef);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Methods for range-based for loops.
|
||||||
|
iterator begin() { return Elements(); }
|
||||||
|
const_iterator begin() const { return Elements(); }
|
||||||
|
const_iterator cbegin() const { return begin(); }
|
||||||
|
iterator end() { return Elements() + Length(); }
|
||||||
|
const_iterator end() const { return Elements() + Length(); }
|
||||||
|
const_iterator cend() const { return end(); }
|
||||||
|
|
||||||
//
|
//
|
||||||
// Search methods
|
// Search methods
|
||||||
//
|
//
|
||||||
|
Loading…
Reference in New Issue
Block a user