I want to override a virtual function in a nested class, from a friend (+child) class. How is this possible? Here is what I tried:
class Parent {
friend class Child;
class Nested {
public: virtual void nestedfunc() {std::cout << "one";}
}
};
class Child : Parent {
void Child::Nested::nestedfun() {std::cout << "two";}
}
But I get:
error: cannot define member function 'Parent::Nested::nestedfunc' within 'Child'
(Same error without "Child::")