Idiom for debug printf?

Bill Baxter dnewsgroup at billbaxter.com
Sun Sep 30 19:21:59 PDT 2007


Is there a common idiom for a version-specific printf?
Something like:

version(Verbose) {
    alias writefln debugfln;
}
else {
    ... what goes here? ...
}

The idea is that it should work just like a call to writefln in the 
version=Verbose case, but it should be a complete no-op otherwise 
(meaning it also shouldn't evaluate its arguments).

I thought there was some way to do this with 'lazy' or somesuch, but I 
don't recall the exact syntax.

Thanks,
--bb


More information about the Digitalmars-d-learn mailing list