Small @nogc experience report

Walter Bright newshound2 at digitalmars.com
Wed Sep 19 19:53:21 UTC 2018


On 9/19/2018 10:13 AM, Shachar Shemesh wrote:
>    assert(condition, string); // string is useless without actual info about 
> what went wrong.
>    assert(condition, format(string, arg, arg)); // No good - format is not @nogc

Another method:

   debug
     assert(condition, format(string, arg, arg));
   else
     assert(condition, string);

because @nogc is ignored in debug conditionals, just like purity is ignored in 
debug conditionals.


More information about the Digitalmars-d mailing list