override toString() for a tuple?

Steve D via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Jun 3 23:25:53 PDT 2014


On Wednesday, 4 June 2014 at 06:04:22 UTC, Jonathan M Davis via 
Digitalmars-d-learn wrote:

> toString is a member of Tuple, and there's no way to override 
> that externally.
...

Hi Jonathan,

Yeah, I'll probably just keep my locally cobbled version of 
typecons.d in my path.
The other options would be hard going as I've got tuples printed 
from arrays and variant arrays etc as well as individually.
It's just easier to hack the default library code, although not 
so elegant. You would think the promise of OO and Inheritance 
would make it easy and free us from hacks like this ;)  That 
said, it's only a personal project so as long as it works, who 
cares?

Many Thanks for your reply
Steve D



More information about the Digitalmars-d-learn mailing list