Debug prints in @nogc
rikki cattermole via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Tue Aug 30 03:36:13 PDT 2016
On 30/08/2016 10:26 PM, Nordlöw wrote:
> I'm struggling with debug printing in my @nogc-containers.
>
> The alternatives:
>
> assert(false, "Fixed message with no parameters");
>
> is not enough for my needs
>
> debug writeln("Fixed");
>
> doesn't bypass @nogc checking. Why?
>
> And temporary commenting out @nogc is cumbersome.
>
> I'm aware of C-style printf but that is not as flexible as writeln.
>
> Any advice?
Static array + formattedWrite, perhaps?
More information about the Digitalmars-d-learn
mailing list