Advertisement
Guest User

Untitled

a guest
Oct 15th, 2019
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.25 KB | None | 0 0
  1. import std.stdio;
  2.  
  3. void print( Args... )( Args args )
  4. {
  5. static foreach( arg ; args )
  6. writeln( arg );
  7. }
  8.  
  9. void main()
  10. {
  11. print(1, "test", [1,2,3]);
  12. /*internally expand to:
  13. writeln(1);
  14. writeln("test");
  15. writeln([1,2,3]);
  16. */
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement