fork download
  1. #include <iostream>
  2.  
  3. void bar()
  4. {
  5. std::cout << "::bar()" << std::endl;
  6. }
  7.  
  8. template <typename T>
  9. class Base
  10. {
  11. public:
  12. void bar() { std::cout << "Base::bar()" << std::endl; }
  13. };
  14.  
  15. template <typename T>
  16. class Derived : public Base<T>
  17. {
  18. public:
  19. void foo() { this->bar(); } // calls Base::bar()
  20. };
  21.  
  22. int main()
  23. {
  24. Derived<int> d;
  25. d.foo();
  26. return 0;
  27. }
Success #stdin #stdout 0s 3096KB
stdin
Standard input is empty
stdout
Base::bar()