diff options
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/SkTInternalLList.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/core/SkTInternalLList.h b/src/core/SkTInternalLList.h index df06d8a255..2f43f1c1eb 100644 --- a/src/core/SkTInternalLList.h +++ b/src/core/SkTInternalLList.h @@ -250,10 +250,25 @@ public: return fCurr; } + /** + * C++11 range-for interface. + */ + bool operator!=(const Iter& that) { return fCurr != that.fCurr; } + T* operator*() { return this->get(); } + void operator++() { this->next(); } + private: T* fCurr; }; + Iter begin() const { + Iter iter; + iter.init(*this, Iter::kHead_IterStart); + return iter; + } + + Iter end() const { return Iter(); } + #ifdef SK_DEBUG void validate() const { SkASSERT(!fHead == !fTail); |