TDPL: Operator Overloading

Andrej Mitrovic andrej.mitrovich at test.com
Wed Aug 25 08:27:13 PDT 2010


What would be really cool is if we had a property that returned a random value of any integrated type. And for user-defined types, maybe it would call a method with a special name. I guess one could make a template function that would do just that.

Andrej Mitrovic Wrote:

> Although that might not work with floats since that would call foo with a NaN value, and if it used that, well that wouldn't really work.
> 
> I could use N.max, but that doesn't work with strings.
> 
> Andrej Mitrovic Wrote:
> 
> > The following seems to work, although I don't know if that's a good idea?:
> 



More information about the Digitalmars-d-learn mailing list