fork(1) download
  1. #include <iostream>
  2. #include <vector>
  3. #include <array>
  4. using namespace std;
  5. template <class T, class... U>
  6. class A{
  7. public:
  8. A(T nameStr, U ...vInput){
  9. name = nameStr;
  10. list = {vInput...};
  11. }
  12. T name;
  13. std::array<int, sizeof...(U)> list;
  14. };
  15. int main() {
  16. // your code goes here
  17. A<string, int, int, int, int> person("Kush", 1, 4, 6, 7);
  18. cout << person.name << " ";
  19. for(auto x : person.list){
  20. cout << x << " ";
  21. }
  22. return 0;
  23. }
Success #stdin #stdout 0s 3468KB
stdin
Standard input is empty
stdout
Kush 1 4 6 7