C++ ambiguous overload for ‘operator ’
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'v read several posts here about this kind of errors, but I wasn't able to solve this one... Has soon I define the operator int and the function f, fails to compile. I tested several things by I wasn't able to solve the issue.... Thanks ex1.cpp: In function ‘int main(int, char**)’: ex1.cpp:35:13: error: ambiguous overload for ‘operator+’ in ‘a + 4’ ex1.cpp:35:13: note: candidates are: ex1.cpp:35:13: note: operator+(int, int) <built-in> In file included from ex1.cpp:3:0: Fraccao.h:41:9: note: Fraccao operator+(const Fraccao&, const Fraccao&)