diff options
author | Stephen Kelly <steveire@gmail.com> | 2015-06-08 18:09:55 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2015-07-04 09:51:27 (GMT) |
commit | 27ff19a96a7d12f2ed6d9683ef733eff6378472a (patch) | |
tree | c76352b9612435e61dc754536b5d827812a0ed07 /Source/cmLinkedTree.h | |
parent | 58853582be7c8a362db5d220c87025a1c19d1c8a (diff) | |
download | CMake-27ff19a96a7d12f2ed6d9683ef733eff6378472a.zip CMake-27ff19a96a7d12f2ed6d9683ef733eff6378472a.tar.gz CMake-27ff19a96a7d12f2ed6d9683ef733eff6378472a.tar.bz2 |
cmLinkedTree: Add operator* to the iterator.
Diffstat (limited to 'Source/cmLinkedTree.h')
-rw-r--r-- | Source/cmLinkedTree.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/Source/cmLinkedTree.h b/Source/cmLinkedTree.h index d2339c4..df00b30 100644 --- a/Source/cmLinkedTree.h +++ b/Source/cmLinkedTree.h @@ -87,6 +87,24 @@ public: return this->Tree->GetPointer(this->Position - 1); } + ReferenceType operator*() const + { + assert(this->Tree); + assert(this->Tree->UpPositions.size() == this->Tree->Data.size()); + assert(this->Position <= this->Tree->Data.size()); + assert(this->Position > 0); + return this->Tree->GetReference(this->Position - 1); + } + + ReferenceType operator*() + { + assert(this->Tree); + assert(this->Tree->UpPositions.size() == this->Tree->Data.size()); + assert(this->Position <= this->Tree->Data.size()); + assert(this->Position > 0); + return this->Tree->GetReference(this->Position - 1); + } + bool operator==(iterator other) const { assert(this->Tree); |