Why does toString() exist? It seems useless.

Don nospam at nospam.com.au
Sun Aug 24 00:14:12 PDT 2008


Leandro Lucarella wrote:
> Don, el 18 de agosto a las 12:41 me escribiste:
>> I cannot understand the rationale for a toString() member function which doesn't 
>> support formatting.
> 
> I think is useful only for debugging purposes.

I agree. Which means that having I/O functions call toString() is a 
broken design (I'm looking at you, writefln!)

> 
>> C++ got around this by giving state to the iostream classes.
> 
> I think C++ formatting is heavily ill. All the manipulator stuff is
> madness.
> 


More information about the Digitalmars-d-learn mailing list