I have stumbled upon this code, and I can't understand, why do I need to specify the class I want to call the method with one argument from? What's more interesting, if I remove the second overloaded method with two parameters, everything will work fine.
class A {
public:
virtual void foo(int a) const final {};
virtual void foo(int a, int b) const = 0;
};
class B : public A {
public:
void foo(int a, int b) const override {}
};
int main() {
B b;
b.A::foo(1); // Why do I need to specify A::foo??
// b.foo(1) -- won't compile
}