fork download
  1. #include <iostream>
  2. #include <vector>
  3.  
  4. template <typename T, template<class...> class Container>
  5. struct A
  6. {
  7. using Ttype = T;
  8. using ContainerType = Container;
  9.  
  10. Container<T> s;
  11. };
  12.  
  13. int main()
  14. {
  15. using S = A<int, std::vector>;
  16.  
  17. S::ContainerType<double> y;
  18. y.push_back(2);
  19.  
  20. return 0;
  21. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:8:25: error: invalid use of template-name ‘Container’ without an argument list
   using ContainerType = Container;
                         ^~~~~~~~~
prog.cpp:4:48: note: ‘template<class ...> class Container’ declared here
 template <typename T, template<class...> class Container>
                                                ^~~~~~~~~
prog.cpp: In function ‘int main()’:
prog.cpp:17:6: error: ‘ContainerType’ is not a member of ‘S’ {aka ‘A<int, std::vector>’}
   S::ContainerType<double> y;
      ^~~~~~~~~~~~~
prog.cpp:17:20: error: expected primary-expression before ‘double’
   S::ContainerType<double> y;
                    ^~~~~~
prog.cpp:18:3: error: ‘y’ was not declared in this scope
   y.push_back(2);
   ^
stdout
Standard output is empty