So, to print or not to print?

Solomon E via Digitalmars-d digitalmars-d at puremagic.com
Tue Apr 26 14:38:32 PDT 2016


On Tuesday, 26 April 2016 at 21:11:22 UTC, Solomon E wrote:
> ...
> writesln(a, b); // I would expect does the same as
> writefln("%s %s", a, b);
>
> alias print = writesln!(separator="\t");
> print(a, b); // now with tab separation
>
> ...

Sorry about using a named template argument when that isn't a 
thing apparently.

writesln!"\t"("A", "B"); // tab separation

void print(string separator = "\t", string eol = "\n", S...)(auto 
ref S args)
{
     writesln!(separator, eol, S)(args);
}
print("A", "B"); // now with tab separation

Those lines successfully run, and I don't know how to define a 
custom "print" shorter yet.



More information about the Digitalmars-d mailing list