Changeing return type of struct.toString()

Benjamin Thaut code at benjamin-thaut.de
Sun Feb 12 10:36:47 PST 2012


I'm currently trying to use D without a gc and didn't have major 
problems so far. A minor issues is that struct.toString() returns a 
string and this will almost allways leak memory when this is called.
The question now is, can I change the return type of struct.toString() 
somewhere inside druntime or is it hardcoded in the compiler?

It was possible without any problems to change the return type of 
Object.toString() and therefore every class in D because Object is the 
baseclass for every class. Is there something similar for structs?

Kind Regards
Benjamin Thaut


More information about the Digitalmars-d mailing list