fork download
  1. #include <iostream>
  2.  
  3. struct A
  4. {
  5. void f() { std::cout << "A::f()" << std::endl; }
  6. };
  7.  
  8. struct B : A
  9. {
  10. void f(int) { std::cout << "B::f(int)" << std::endl; }
  11. };
  12.  
  13. int main() {
  14. B b;
  15. b.f(10); //ok
  16. b.A::f(); //ok - explicitly selecting the hidden function using scope resolution
  17. return 0;
  18. }
Success #stdin #stdout 0.02s 2724KB
stdin
Standard input is empty
stdout
B::f(int)
A::f()