March 2014 update

This commit is contained in:
Ingy döt Net 2014-04-02 16:56:35 +00:00
parent 09687c4926
commit a25938f123
1846 changed files with 21876 additions and 5203 deletions

View file

@ -2,22 +2,22 @@ import std.stdio, std.algorithm;
void printAll(TyArgs...)(TyArgs args) {
foreach (el; args)
writeln(el);
el.writeln;
}
// Typesafe variadic function for dynamic array
void showSum1(int[] items...) {
writeln(reduce!q{a + b}(0, items));
items.sum.writeln;
}
// Typesafe variadic function for fixed size array
void showSum2(int[4] items...) {
writeln(reduce!q{a + b}(0, items));
items[].sum.writeln;
}
void main() {
printAll(4, 5.6, "Rosetta", "Code", "is", "awesome");
writeln();
printAll(4, 5.6, "Rosetta", "Code", "is", "awseome");
writeln;
showSum1(1, 3, 50);
showSum2(1, 3, 50, 10);
}