fork download
  1. template <typename T>
  2. struct foo;
  3.  
  4. template <typename... Types>
  5. class Collection
  6. {
  7.  
  8. };
  9.  
  10. template <
  11. template <typename...> class Container,
  12. typename... Types>
  13. struct foo<Container<Types...>> : Types...
  14. {
  15. int x;
  16. };
  17.  
  18. class ClassA
  19. {
  20. public:
  21. int val1;
  22. };
  23. class ClassB
  24. {
  25. public:
  26. int val2;
  27. };
  28.  
  29. int main()
  30. {
  31. foo<Collection<ClassA, ClassB>> f;
  32.  
  33. f.val1 = 10;
  34. f.val2 = 20;
  35. return 0;
  36. }
Not running #stdin #stdout 0s 0KB
stdin
Standard input is empty
stdout
Standard output is empty