PROPOSAL: Implicit conversions of integer literals to floating

so so at so.do
Sat Jan 1 08:34:08 PST 2011


> I'd be in favor of that. Can't see it break stuff in anything but
> good ways.

I am not sure if it is that good.
Say you want to make a generic vector class that accepts both integer and  
float values.
This might seem trivial, well it is but it gets very ugly. You are going  
to need cast on each literal!
Using C (non-generic) literal system in a generic language IMHO is very  
ugly even with the existence of implicit casting.

-- 
Using Opera's revolutionary email client: http://www.opera.com/mail/


More information about the Digitalmars-d mailing list