best replacement for - cout << "hello D" << endl; ?
dnewsgroup at billbaxter.com
Wed Jul 11 19:42:21 PDT 2007
Carlos Santander wrote:
> Bruce Adams escribió:
>> and type safe compared to:
>> stdout.writefln("%s%s%i", foo,bar,2);
> D has typesafe variadics, so you can just say:
> dout.writefln("%s%s%s", foo,bar,2);
Or just dout.writefln(foo,bar,2); in this case.
> %s doesn't mean "pretend it's a string," but rather "write its string
I agree that compile time type-checked format parameters would be nice.
>> ERROR: someObject is not an integer
Would be nice. A couple of people were trying to get this to work using
compile time string processing. Maybe they'll pipe in here at some point...
More information about the Digitalmars-d-learn