fork download
  1. #include <iostream>
  2.  
  3. namespace dbj {
  4. /*
  5.   print() non recursive version
  6.  also with no format token, because it is tedious for
  7.  when there is a lot of them to remember on the right
  8.  of the format sentence what values to provide and in which order
  9.  */
  10. template<typename... Targs>
  11. inline void print (Targs... args)
  12. {
  13. if (sizeof...(Targs) > 0) {
  14. // since initializer lists guarantee sequencing, this can be used to
  15. // call a function on each element of a pack, in order:
  16. char dummy[sizeof...(Targs)] = { ( (std::cout << args), 0)... };
  17. }
  18. }
  19. }
  20.  
  21. int main() {
  22. dbj::print ("\nANSI", "\nUnicode ₠ ₡ ₢ ₣ ₤ ₥ ₦ ₧ ₨ ₩ ₪ ₫" );
  23. return 0;
  24. }
Success #stdin #stdout 0s 16064KB
stdin
Standard input is empty
stdout
ANSI
Unicode ₠ ₡ ₢ ₣ ₤ ₥ ₦ ₧ ₨ ₩ ₪ ₫