Overload by return type

Tim M a at b.com
Tue Jan 13 23:26:26 PST 2009


On Wed, 14 Jan 2009 18:31:53 +1300, dsimcha <dsimcha at yahoo.com> wrote:

> Just curious, why doesn't D, and why don't more statically typed  
> languages in
> general, support overload by return type?  I haven't exactly thought  
> through
> all the pros and cons, but at first glance it seems like an incredibly  
> useful
> thing.  What's the catch that I'm missing?


Templates kind of give you that sort of power. If you weren't taking the  
return value then it wouldn't work without some extra rules. I think  
opCast should be changed to allow unlimited availables casts.



More information about the Digitalmars-d mailing list