Denis Koroskin schrieb:
One note is that you should probably pass the object by reference:

void log(T)(ref T obj) { ... }        // D1
void log(T)(ref const(T) obj) { ... } // D2


Good idea. btw ref'ing a class has no effect, has it?

Actually discovered a flaw, if you e.g. pass an array of structs to it, dmd complains about the struct not having a toString() member.

So it needs to be recursive somehow.

Reply via email to