fork download
  1. template <typename T, typename N> class Bar;
  2.  
  3. template <typename T, typename N>
  4. class Foo
  5. {
  6. Bar<T, N> derp;
  7. };
  8.  
  9. class Bar<typename T, typename N>
  10. {
  11. Foo<T, N> derp;
  12. };
  13.  
  14. class Hell
  15. {
  16. Foo<Bar, Foo>
  17. };
  18.  
  19. int main()
  20. {
  21. Hell pMe;
  22. }
Compilation error #stdin compilation error #stdout 0.12s 31992KB
stdin
Standard input is empty
compilation info
prog.cpp:9:33: error: wrong number of template arguments (1, should be 2)
 class Bar<typename T, typename N>
                                 ^
prog.cpp:1:41: error: provided for ‘template<class T, class N> class Bar’
 template <typename T, typename N> class Bar;
                                         ^
prog.cpp:9:7: error: an explicit specialization must be preceded by ‘template <>’
 class Bar<typename T, typename N>
       ^
prog.cpp:16:14: error: type/value mismatch at argument 1 in template parameter list for ‘template<class T, class N> class Foo’
  Foo<Bar, Foo>
              ^
prog.cpp:16:14: error:   expected a type, got ‘Bar’
prog.cpp:16:14: error: type/value mismatch at argument 2 in template parameter list for ‘template<class T, class N> class Foo’
prog.cpp:16:14: error:   expected a type, got ‘Foo’
prog.cpp:17:1: error: expected unqualified-id before ‘}’ token
 };
 ^
prog.cpp: In function ‘int main()’:
prog.cpp:21:7: warning: unused variable ‘pMe’ [-Wunused-variable]
  Hell pMe;
       ^
stdout
Standard output is empty