new string mixins -- debug printfs

BCS BCS at pathlink.com
Tue Feb 6 09:11:45 PST 2007


Bill Baxter wrote:
> Here's something fun that's now possible:
> 
> version(trace) {
>     template Trace(char[] msg="") {
>         const char[] Trace =
>            `writefln("%s(%s): `~msg~`", __FILE__, __LINE__);`;

i'd use

`writefln(__FILE__"("~itoa!(__LINE__)~"): %s), "`~msg~`");`;

file and line get folded and % dosn't mess thing up

COOL



More information about the Digitalmars-d mailing list