fork download
  1. #include <iostream>
  2. using std::cout;
  3. using std::endl;
  4.  
  5. class Base {
  6.  
  7. public:
  8. void Func(int) { cout << "Base::Func Implementation" << endl; }
  9. };
  10.  
  11. class Derived : public Base {
  12.  
  13. public:
  14. // Bring Base::Func into derived class.
  15. using Base::Func;
  16.  
  17. // Hides the Base::Func with same defined in base class.
  18. void Func() { cout << "Derived::Func Implementation" << endl; }
  19. };
  20.  
  21. int main()
  22. {
  23. Derived D;
  24. D.Func(5);
  25. }
Success #stdin #stdout 0s 3296KB
stdin
Standard input is empty
stdout
Base::Func Implementation