fork download
  1. #include <iostream>
  2. #include <string>
  3.  
  4. using std::string;
  5. using std::cout;
  6.  
  7. template <typename... Types>
  8. class Test
  9. {
  10. public:
  11. template <typename T>
  12. void Func(T t1, T t2, T t3){
  13. cout << t1 << ',' << t2 << ',' << t3 << '\n';
  14. } // I don't know how to declare such a function
  15. };
  16.  
  17. int main()
  18. {
  19. Test<string, bool, long> myTest; // Three types
  20. myTest.Func(905, 36, 123315); // Three arguments, but always of type int.
  21. return 0;
  22. }
Success #stdin #stdout 0s 3468KB
stdin
Standard input is empty
stdout
905,36,123315