Blogpost about the T.init problem

FeepingCreature feepingcreature at gmail.com
Fri Jul 27 12:23:39 UTC 2018


On Monday, 23 July 2018 at 14:26:17 UTC, Nick Treleaven wrote:
> On Wednesday, 11 July 2018 at 07:30:59 UTC, FeepingCreature 
> wrote:
>> To reproduce the format issue, try to print the struct with 
>> writefln!"%s"(MyDomainType()).
>
> I implemented the compile time format string checking by 
> evaluating `format(fmtStr, Args.init)` at compile time and 
> seeing if an exception was thrown. So the above problem could 
> be worked around by guarding the invariant test with a check 
> that CTFE is not active.

Note that I've gotten a fix for this merged that doesn't break 
format use in ctfe: the compile time format string check simply 
writes into a NoOpSink, and the formattedWriter detects the 
NoOpSink and skips the toString.

So that's good now.


More information about the Digitalmars-d-announce mailing list