fork download
  1. class Parent {
  2. protected:
  3. virtual int f() = 0;
  4. int DelegateF(Parent& p) { return p.f(); }
  5. };
  6.  
  7. class Child : public Parent {
  8. using Parent::f;
  9. protected:
  10. int g(Parent& p) {
  11. return DelegateF(p); // OK.
  12. }
  13. int g(Child& p) {
  14. return DelegateF(p); // OK.
  15. }
  16. };
  17.  
  18. int main()
  19. {
  20. return 0;
  21. }
Success #stdin #stdout 0s 3336KB
stdin
Standard input is empty
stdout
Standard output is empty