fork(4) download
  1. #include <iostream>
  2.  
  3. //template <typename ... A>
  4. //void foo(char a, A ... args);
  5.  
  6. template <typename T> void P(T x) { std::cout << x << ' '; }
  7.  
  8. void foo(char a) { P(3); P(a); }
  9.  
  10. template <typename ... A>
  11. void foo(int a, A ... args)
  12. {
  13. foo(args...);
  14. P(a);
  15. }
  16.  
  17. template <typename ... A>
  18. void foo(char a, A ... args)
  19. {
  20. P(a);
  21. foo(args...);
  22. }
  23.  
  24. int main()
  25. {
  26. foo('1', '2', 48, '4', '5');
  27. }
Success #stdin #stdout 0s 3456KB
stdin
Standard input is empty
stdout
1 2 3 5 52 48