各位前辈分析一下这个错误
class Channel
{
public:
int list;
double hz;
string name;
Channel(int a=0,double b=0.0,string c=" ");
friend ostream &operator<<(ostream &output,Channel &ob);
};
ostream &operator<<(ostream &output,Channel &ob)
{
output<<"( "<<ob.name<<" ";
output<<ob.list<<" ";
output<<ob.hz<<" "<<" )\n";
return output;
}
重载<<之后,
输出cout<<p->m_element<<endl;
p->m_element是Channel类型
提示错误error C2593: 'operator <<' is ambiguous
我以前编译是正确的,
过了一段时间编译怎么是错误的??