<br><br><div class="gmail_quote">On Fri, Jan 4, 2013 at 2:59 AM, bearophile <span dir="ltr"><<a href="mailto:bearophileHUGS@lycos.com" target="_blank">bearophileHUGS@lycos.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br></blockquote></div>
Someday I'd like a function like this in Phobos, that verifies the formatting string at compile-time:<br>
<br>
ctwritefln!"%d %s"(5, "hello");<br>
<br>
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.<br></blockquote>
<div><br></div><div>You can find a partial version in a template tutorial I put on github.</div><div><br></div><div><a href="https://github.com/PhilippeSigaud/D-templates-tutorial/">https://github.com/PhilippeSigaud/D-templates-tutorial/</a> </div>
<div><br></div><div>Select either of the .md, .pdf, .html or .epub version of the tutorial. It's section 5.11 "Statically-Checked Writeln".</div><div><br></div><div>The code worked the last time I launched the automated extractor/tester (before 2.061).</div>
<div><br></div></div>