fork(2) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int print_test(int i)
  5. {
  6. std::cout << ',' << i << '\n';
  7. return 0;
  8. }
  9.  
  10. template <typename... Args>
  11. void print(Args... args)
  12. {
  13.  
  14. using expandir = int[];
  15. (void) expandir {0, ((void)print_test(args), 0)...};
  16.  
  17. (std::cout << ... << args) << '\n';
  18.  
  19. }
  20.  
  21. int main() {
  22. // your code goes here
  23. print(1,2,3,4,5);
  24. return 0;
  25. }
Success #stdin #stdout 0s 15240KB
stdin
Standard input is empty
stdout
,1
,2
,3
,4
,5
12345