From 682bfa273261b7b506dd7921db919f6e8f7f45da Mon Sep 17 00:00:00 2001 From: whitequark Date: Sun, 29 May 2016 14:14:38 +0000 Subject: [PATCH] Add STL begin()/end() functions to List and IdList. This will allow us to use it in the C++11 foreach loop, as well as simplify use of STL . --- src/dsc.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/dsc.h b/src/dsc.h index 0b01030..49e2a60 100644 --- a/src/dsc.h +++ b/src/dsc.h @@ -195,6 +195,11 @@ public: return prev + 1; } + T *begin() { return &elem[0]; } + T *end() { return &elem[n]; } + const T *begin() const { return &elem[0]; } + const T *end() const { return &elem[n]; } + void ClearTags() { int i; for(i = 0; i < n; i++) { @@ -351,6 +356,11 @@ public: return prev + 1; } + T *begin() { return &elem[0]; } + T *end() { return &elem[n]; } + const T *begin() const { return &elem[0]; } + const T *end() const { return &elem[n]; } + void ClearTags() { int i; for(i = 0; i < n; i++) {