@property - take it behind the woodshed and shoot it? - writefln

Philippe Sigaud philippe.sigaud at gmail.com
Thu Jan 24 09:04:37 PST 2013


On Thu, Jan 24, 2013 at 4:53 PM, Nick Treleaven
<ntrel-public at yahoo.co.uk> wrote:

> write!"%s\n" = someExpression;
>
> :-p
>
> Seriously, it would be nice to have a compile-time checked format string for
> writefln.

I made a stab at it in a template tutorial that can be found on github:

https://github.com/PhilippeSigaud/D-templates-tutorial

You can grab the pdf, it's on section 5.11, p. 168 (Statically-Checked Writeln)

Use example:

cwritefln!"For sample #%d, the results are (%s, %f)"( 0, "foo", 3.14);


More information about the Digitalmars-d mailing list