'operator <<' is ambiguous
来源:互联网 发布:cae软件下载 编辑:程序博客网 时间:2024/04/29 11:46
'operator <<' is ambiguous
class Time{
public:
int hour, minute, second;
public:
void set(int h, int m, int s){ hour=h, minute=m, second=s; }
friend Time& operator++(Time& a);
friend Time operator++(Time& a, int);
friend ostream& operator<<(ostream& o, const Time& t);
};
自定义类中重载操作符后,调用时,编译提示错误:'operator <<' is ambiguous
解决方法:
VC6.0 需要先声明类和重载操作符
class Time;
ostream& operator<<(ostream& o, const Time& t);
VC 6.0 在SP3之前, 对iostream与friend有Bug, 需要patch----SP5。可能这样的错误与编译器有关吧。
- 'operator <<' is ambiguous
- 'operator <<' is ambiguous
- error C2593: 'operator +=' is ambiguous
- c++:error C2593: \'operator <<\' is ambiguous
- json error: Use of overloaded operator [] is ambiguous
- error C2593: 'operator <<' is ambiguous error C2504: 'unary_function' : base class undefined
- 『'operator <<' is ambiguous』 以及『 操作符重载示例』
- MFC程序从VC6.0移植到VS2005出现'operator +=' is ambiguous 的错误
- where clause is ambiguous
- 解决VC6.0中ostringstream类输出__int64类型导致的错误error C2593: 'operator <<' is ambiguous
- reference to "transform" is ambiguous
- Mysql, where clause is ambiguous
- What is operator overloading
- Column 'id' in where clause is ambiguous
- Column 'id' in where clause is ambiguous
- OpenCV4Android 'size_t' is ambiguous ' Candidates are: '‘问题解决
- column 'id' in field list is ambiguous
- method is ambiguous for the type
- windows笔记-创建线程的另一个函数_beginthreadex
- SWT窗口居中的设置
- 安装完oracle后,发现计算机名不符合要求
- poj 2400 Supervisor,Supervisee
- hello android v3 (1):r.java中的layout
- 'operator <<' is ambiguous
- int 和 String 互相转换的多种方法
- mysql数据据存储引擎InnoDB和MyISAM的优势及区别
- struts2中格式化输出数字和日期的方法
- [转]告别程序员生涯,一点感慨,与诸君共勉
- 使用Spring2.0配置事件管理。
- struts2 Interceptor(拦截器)中获取HTTP 参数的方法
- 查看Ubuntu版本信息
- [转]程序人生的十字路口