fork(5) download
  1. #include <iostream>
  2. #include <sstream>
  3.  
  4. template<typename ... Ts>
  5. std::string concat(Ts&&...args)
  6. {
  7. std::stringstream ss;
  8. const int dummy[] = {0, (ss << std::forward<Ts>(args), 0)...};
  9. static_cast<void>(dummy); // avoid warning for unused variable
  10. return ss.str();
  11. }
  12.  
  13. int main()
  14. {
  15. std::cout << concat(88, 'a', "home", 9) << std::endl;
  16. return 0;
  17. }
  18.  
  19.  
Success #stdin #stdout 0s 3428KB
stdin
Standard input is empty
stdout
88ahome9