fork download
  1. #include <iostream>
  2. #include <vector>
  3. #include <tuple>
  4.  
  5. using namespace std;
  6.  
  7. template<typename... Ts>
  8. struct Typelist
  9. {
  10. static constexpr std::size_t size { sizeof...(Ts) };
  11. };
  12.  
  13. template<class, class> class World;
  14.  
  15. template<template<typename... Arg1> class T1, template<typename... Arg2> class T2>
  16. class World<Typelist, Typelist>
  17. {
  18.  
  19. private:
  20. std::tuple<std::vector<T1>...> m1;
  21. std::tuple<std::vector<T2>...> m2;
  22. };
  23.  
  24.  
  25. int main() {
  26. // your code goes here
  27. using TL1 = Typelist<int, char, double>;
  28. using TL2 = Typelist<float, unsigned int, bool>;
  29.  
  30. World<TL1, TL2> w2;
  31. return 0;
  32. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:16:31: error: type/value mismatch at argument 1 in template parameter list for ‘template<class, class> class World’
 class World<Typelist, Typelist>
                               ^
prog.cpp:16:31: note:   expected a type, got ‘Typelist’
prog.cpp:16:31: error: type/value mismatch at argument 2 in template parameter list for ‘template<class, class> class World’
prog.cpp:16:31: note:   expected a type, got ‘Typelist’
prog.cpp: In function ‘int main()’:
prog.cpp:30:18: error: aggregate ‘World<Typelist<int, char, double>, Typelist<float, unsigned int, bool> > w2’ has incomplete type and cannot be defined
  World<TL1, TL2> w2;
                  ^~
stdout
Standard output is empty