我有下一个代码:
void f(int){}
struct A
{
void f()
{
f(1);
}
};
此代码格式不正确,错误消息(GCC):error: no matching function for call to ‘A::f(int)’或(clang) Too many arguments to function call, expected 0, have 1; did you mean '::f'?。
为什么我需要使用:: 来调用与成员函数同名但签名不同的非会员函数?这一需求的动机是什么?
我认为编译器应该能够找到它