fork download
  1. #include <iostream>
  2. #include <iomanip>
  3. #include <sstream>
  4.  
  5. using namespace std;
  6.  
  7. void tfunc(stringstream&)
  8. {}
  9.  
  10. template<typename T, typename ... Arguments>
  11. void tfunc(stringstream& s, T t, Arguments ... args)
  12. {
  13. s << t << " ";
  14. tfunc(s,args...);
  15. }
  16.  
  17. int main(int argc, const char * argv[])
  18. {
  19. stringstream s;
  20. tfunc(s,1,0.5,",,,");
  21. cout << s.str() << endl;
  22. }
  23.  
Success #stdin #stdout 0s 15240KB
stdin
Standard input is empty
stdout
1 0.5 ,,,