fork download
  1. #include <iostream>
  2. #include <utility>
  3.  
  4. using namespace std;
  5.  
  6. template <typename T>
  7. struct foo {
  8. typedef pair<T, T> PointType;
  9. PointType point;
  10. };
  11.  
  12. int main() {
  13. foo<int> myFoo;
  14. myFoo::PointType myBar;
  15.  
  16. myBar.first = 13;
  17. myBar.second = 42;
  18.  
  19. cout << myBar.first << ' ' << myBar.second << endl;
  20. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:14:5: error: ‘myFoo’ is not a class, namespace, or enumeration
     myFoo::PointType myBar;
     ^~~~~
prog.cpp:16:5: error: ‘myBar’ was not declared in this scope
     myBar.first = 13;
     ^~~~~
stdout
Standard output is empty