As a followup question to this question:
class Base {
public:
virtual ~Base() {}
virtual void func() = 0;
};
class A : public Base {
public:
void func() override { std::cout << this << std::endl; }
};
class B : public Base {
private:
Base& base;
public:
B(B&) = delete;
B(Base& b) : base(b) {}
void func() override { std::cout << &base << std::endl; }
};
int main()
{
A a;
B b(a);
B c(b);
return 0;
}
Why does overload resolution not fall back to the constructor taking a reference to the base class (B(Base& b)) when the copy constructor is deleted?