fork download
  1. #include <iostream>
  2.  
  3. template <typename T> struct Foo {
  4.  
  5. template <typename F> void CallBar ( F abar ) {
  6. Bar( abar );
  7. }
  8.  
  9. };
  10.  
  11. struct Baz : public Foo<int> {
  12.  
  13. template <typename F> void Bar ( F ) {
  14. std::cout << "Bars everywhere, bitches.\n";
  15. }
  16.  
  17. };
  18.  
  19. int main (int argc, char* argv[]) {
  20.  
  21. Baz baz;
  22. baz.CallBar( argc );
  23.  
  24. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Goo goo gooo!
compilation info
prog.cpp: In member function 'void Foo<T>::CallBar(F) [with F = int, T = int]':
prog.cpp:22:23:   instantiated from here
prog.cpp:6:9: error: 'Bar' was not declared in this scope
stdout
Standard output is empty