Temporarily disable all purity for debug prints

bearophile bearophileHUGS at lycos.com
Tue Apr 12 12:48:33 PDT 2011


Walter:

> pure void foo()
> {
>      debug writeln("in foo()");
> }
> 
> Simple and effective.

Very simple designs are sometimes the mark of the genius. But isn't your idea able to lead to debug code that's more buggy than the nondebug code, if some side effect (like modifying a global) is used inside a debug{}?

Bye,
bearophile


More information about the Digitalmars-d mailing list