fork download
  1. #include <iostream>
  2.  
  3. void print()
  4. {
  5. }
  6.  
  7. template<typename T, typename... U>
  8. void print(const T& t, const U&... u)
  9. {
  10. std::cout << t;
  11. print(u...);
  12. }
  13.  
  14. template<typename... T>
  15. void println(const T&... t)
  16. {
  17. print(t...);
  18. std::cout.put('\n');
  19. }
  20.  
  21. int main()
  22. {
  23. auto s = "sucker";
  24. println(42, " is the answer, ", s, '!');
  25. }
  26.  
Success #stdin #stdout 0s 3340KB
stdin
Standard input is empty
stdout
42 is the answer, sucker!