generic toString() in a template class?

Bill Baxter dnewsgroup at billbaxter.com
Tue Jan 16 17:00:38 PST 2007


%u wrote:
> I wonder how one could write generic toString() method in a template class?
> 
>[...]
> 
> My suggestions:
> 
> -- if the compiler see a basic type, int.toString(), translate into a function
> that does the Right Thing; just as if .toString() is also a property of basic
> types like int.max, int.min.

I'm all for the Smalltalk-ish idea of making built-in types act more 
like full-fledged objects.

--bb



More information about the Digitalmars-d mailing list