课堂测试:
ostream& operator <<(ostream& os, const Test& test){
os<<"hooooo"<<endl;
return os;
}
在测试代码中:
Test t2 = Test(10, 20);
为什么cout<< t2 <<endl
编译弹出错误?我已经完善了<<。
'std::cout << t2' 中的 'operator<<' 不匹配
课堂测试:
ostream& operator <<(ostream& os, const Test& test){
os<<"hooooo"<<endl;
return os;
}
在测试代码中:
Test t2 = Test(10, 20);
为什么cout<< t2 <<endl
编译弹出错误?我已经完善了<<。
'std::cout << t2' 中的 'operator<<' 不匹配