fork(7) 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.f(); //error - as the function is hidden
  17. return 0;
  18. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:16: error: no matching function for call to ‘B::f()’
prog.cpp:10: note: candidates are: void B::f(int)
stdout
Standard output is empty