fork download
  1. #include <iostream>
  2.  
  3. void foo()
  4. {
  5. std::cout << "global foo()" << std::endl;
  6. }
  7.  
  8. struct A {
  9. void foo()
  10. {
  11. std::cout << "A::foo()" << std::endl;
  12. }
  13. };
  14.  
  15. template <typename T>
  16. struct B : public T {
  17. void call()
  18. {
  19. foo();
  20. }
  21. };
  22.  
  23. int main(int argc, char **argv )
  24. {
  25. B<A> b;
  26. b.call();
  27. return 0;
  28. }
  29.  
Success #stdin #stdout 0.02s 2724KB
stdin
Standard input is empty
stdout
global foo()