为什么不能返回 ostream 对象??
为什么一定要这样表达?
ostream& operator<<( ostream& output, const string& s ){
output<< s.sPtr;
return output;
}
改为 ostream operator<<(……) 就出错?
不是说尽可能不返回对对象的应用么。 上一句错在哪?
问题点数:20、回复次数:2Top
1 楼chxr(sxl)回复于 2001-11-06 13:44:44 得分 20
不是引用。能作为左值吗? :)Top
2 楼atu2001()回复于 2001-11-06 18:28:22 得分 0
我想主要是方便这样子调用ostream的吧:
os<<int<<string<<......
第一遍以后变成:
os<<string<<...
递归直到结束Top




