fork(2) download
  1. #include <cstdio>
  2.  
  3. class BaseClass
  4. {
  5. public:
  6. void func(int a){puts("BaseClass::func(int)");};
  7. void func(int a, int b){puts("BaseClass::func(int, int)");};
  8. void func(int a, int b, int c){puts("BaseClass::func(int, int, int)");};
  9. };
  10.  
  11. class DerivedClass : public BaseClass
  12. {
  13. public:
  14. void func(int a){puts("DerivedClass::func(int)");}
  15. using BaseClass::func;
  16. };
  17.  
  18. int main()
  19. {
  20. DerivedClass obj;
  21. obj.func(0);
  22. obj.func(0, 0); // error - not any more
  23. obj.func(0, 0, 0); // error - not any more
  24.  
  25. return 0;
  26. }
Success #stdin #stdout 0s 3340KB
stdin
Standard input is empty
stdout
DerivedClass::func(int)
BaseClass::func(int, int)
BaseClass::func(int, int, int)