Safety/purity and assert/enforce error messages

Joseph Rushton Wakeling joseph.wakeling at webdrake.net
Thu Sep 12 12:01:55 PDT 2013


On 12/09/13 20:49, H. S. Teoh wrote:
> In phobos git HEAD, std.format has been made pure @safe nothrow (and
> CTFE-able), so you should be able to write your assert as:
>
> 	assert(condition, format("x = %s, blahblah", x));
>
> Don't think it will work on 2.063.2, though, since it was a relatively
> recent change. I suspect this will only work starting from 2.064.

Ahh, good to know, thanks.  I guess I'll withhold tweaking such things until 
after the next release ... :-)



More information about the Digitalmars-d-learn mailing list