On Fri, Jan 4, 2013 at 2:59 AM, bearophile <bearophileHUGS@lycos.com> wrote:

Someday I'd like a function like this in Phobos, that verifies the formatting string at compile-time:

ctwritefln!"%d %s"(5, "hello");

Such function can be written with just a very light wrapper around a normal writefln (and later to something more optimized). This means that the actual template bloat can be minimized a lot, but not fully removed.

You can find a partial version in a template tutorial I put on github.

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

Select either of the .md, .pdf, .html or .epub version of the tutorial. It's section 5.11 "Statically-Checked Writeln".

The code worked the last time I launched the automated extractor/tester (before 2.061).