In RBNode:
Code:
virtual RBNode & operator=(const RBNode & rhs);
RBNode & RBNode::operator=(const RBNode & rhs)
{
this->left = rhs.left;
this->right = rhs.right;
this->parent = rhs.parent;
this->color = rhs.color;
return *this;
}
I put a breakpoint there and it doesn't stop. It doesn't get there @_@
any ideas?
and yes I am sure there is an assignment in my code, for example, here:
Code:
RBNode* RedBlackTree::Delete(RBNode* z)
{
RBNode *y, *x;
if (z->left == this->nil || z->right == this->nil)
y = z;
else
y = TreeSuccessor(z);
if (y->left != this->nil)
x = y->left;
else
x = y->right;
x->parent = y->parent;
if (y->parent == this->nil)
{
this->root = x;
}
else if (y == y->parent->left)
{
y->parent->left = x;
}
else
y->parent->right = x;
if (y != z)
{
y->CopyTo(z);
}
if (y->color == BLACK)
this->DeleteFixup(x);
return y;
}
Even though the pointers reffer to derived classes (such as BookNode) it still has to invoke the RBNode:perator = since the refferences declared as RBNode... (right?)