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