Andrej Mitrovic:

> I realize runtime checks would be out of the question, but I'm looking for 
> compile-time checks when it's possible to do so.

GCC is often able to catch such bugs, but Walter has recently closed my 
enhancement request about this :-(
http://d.puremagic.com/issues/show_bug.cgi?id=4458

So a solution is to build a fwrite/fwriteln that uses a compile-time string for 
formatting, that performs compile-time tests using the more efficient CTFE of 
DMD 2.053:

int foo, bar;
fwriteln!"%d %s"(foo, bar); // compile-time error: bar isn't a string!

Bye,
bearophile

Reply via email to