当我重载一个运算符时,它是否会失去其对之前定义的类型的运算符的能力,或者新定义是否仅在我调用时适用
cout << that_specific_class_type_variable
如果我写cout << that_specific_class_type_variabe->Left()
它是重载函数还是正常的 cout 语句?
ostream& operator<< (ostream& out, TreeNode* tptr)
{
if(tptr!=NULL)
{
operator<<(out,tptr->Left());
out<<(*(tptr->Entry()));
operator<<(out,t->Right());
}
return out;
}