Flags=0x3 };
typedef ImutAVLTree<ImutInfo> TreeTy;
- typedef ImutAVLTreeGenericIterator<ImutInfo> SelfTy;
ImutAVLTreeGenericIterator() {}
ImutAVLTreeGenericIterator(const TreeTy *Root) {
}
}
- bool operator==(const SelfTy &x) const { return stack == x.stack; }
+ bool operator==(const ImutAVLTreeGenericIterator &x) const {
+ return stack == x.stack;
+ }
- bool operator!=(const SelfTy &x) const { return !operator==(x); }
+ bool operator!=(const ImutAVLTreeGenericIterator &x) const {
+ return !(*this == x);
+ }
- SelfTy &operator++() {
+ ImutAVLTreeGenericIterator &operator++() {
assert(!stack.empty());
TreeTy* Current = reinterpret_cast<TreeTy*>(stack.back() & ~Flags);
assert(Current);
return *this;
}
- SelfTy &operator--() {
+ ImutAVLTreeGenericIterator &operator--() {
assert(!stack.empty());
TreeTy* Current = reinterpret_cast<TreeTy*>(stack.back() & ~Flags);
assert(Current);
public:
typedef ImutAVLTree<ImutInfo> TreeTy;
- typedef ImutAVLTreeInOrderIterator<ImutInfo> SelfTy;
ImutAVLTreeInOrderIterator(const TreeTy* Root) : InternalItr(Root) {
if (Root)
ImutAVLTreeInOrderIterator() : InternalItr() {}
- bool operator==(const SelfTy &x) const {
+ bool operator==(const ImutAVLTreeInOrderIterator &x) const {
return InternalItr == x.InternalItr;
}
- bool operator!=(const SelfTy &x) const { return !(*this == x); }
+ bool operator!=(const ImutAVLTreeInOrderIterator &x) const {
+ return !(*this == x);
+ }
TreeTy &operator*() const { return *InternalItr; }
TreeTy *operator->() const { return &*InternalItr; }
- SelfTy &operator++() {
+ ImutAVLTreeInOrderIterator &operator++() {
do ++InternalItr;
while (!InternalItr.atEnd() &&
InternalItr.getVisitState() != InternalIteratorTy::VisitedLeft);
return *this;
}
- SelfTy &operator--() {
+ ImutAVLTreeInOrderIterator &operator--() {
do --InternalItr;
while (!InternalItr.atBeginning() &&
InternalItr.getVisitState() != InternalIteratorTy::VisitedLeft);