++ Operator Iterator for a BST Class


0
down vote
favorite

I have already created a BST class, with a root node, and left and right node. It is working perfectly. I am trying to create a ++ operator Iterator, which can just go through each node and increment its. This is what I get so far, I am still thinking it gat something to do with my constructor. Please help, below is just the nested Iterator class that I included in the BST class. I just cout to see if it is working but it keeps printing out 0. class Iterator { private: // private iterator state... nodeptr root; public: Iterator(nodeptr roots_) : root(roots_) {}; ~Iterator() {} bool operator!=(const Iterator& rhs) const { return (this-> root != rhs.root); } bool operator==(const Iterator& rhs) const { return (this->root == rhs.root); }
Why is this post so much shittier than your SO submission?

https://stackoverflow.com/questions/49426718/operator-for-a-bst-class
Topic archived. No new replies allowed.