Consider the following example with several layers of inheritance:
struct A {
void operator()(double x);
};
struct B: A {
using A::operator();
template <class... T> void operator()(T... x);
};
struct C: B {
using B::operator();
void operator()() const;
void operator()(int x) const;
};
struct D: C {
using C::operator();
void operator()();
};
Will the overload resolution work exactly as if D
had been written as:
struct D {
void operator()(double x);
template <class... T> void operator()(T... x);
void operator()() const;
void operator()(int x) const;
void operator()();
};
or in the contrary, the compiler tries to find a working overload in D
, then in C
, then in B
, then in A
? In other words, does inheritance play any role in overload resolution (for functions that do not have the same signature), or not?