fork download
  1. #include <vector>
  2. #include <list>
  3.  
  4. int main(int argc, char* argv[])
  5. {
  6. std::vector< std::list<int> > v; // this compiles
  7. std::vector<std::list> v2; // and this doesn't
  8.  
  9. return 0;
  10. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main(int, char**)’:
prog.cpp:7:26: error: type/value mismatch at argument 1 in template parameter list for ‘template<class _Tp, class _Alloc> class std::vector’
prog.cpp:7:26: error:   expected a type, got ‘list’
prog.cpp:7:26: error: template argument 2 is invalid
prog.cpp:7:30: error: invalid type in declaration before ‘;’ token
prog.cpp:7:28: warning: unused variable ‘v2’ [-Wunused-variable]
stdout
Standard output is empty