generic + numeric + literals = abomination
so at so.do
Sat Mar 27 05:47:03 PDT 2010
On Sat, 27 Mar 2010 13:52:28 +0200, bearophile <bearophileHUGS at lycos.com>
> Can you explain better what the problem is and what kind of solution you
> would like?
One thing i can think of now is adding another float literal, maybe 'r',
Which means you are free to cast this to any floating point suitable.
Some kind of template, i don't know!
So when i have something like this :
scalar m = 0.99999999999999999999999999r;
when scalar is f32 :
scalar m = 0.99999999999999999999999999f;
when scalar is f64 :
scalar m = 0.99999999999999999999999999;
And it is easy to detect for the compiler i guess.
scalar m = 0.2r; // just cast it to scalar, user wants to assign to a
scalar n = m * 4.5r; // again just cast it to scalar, user wants to
multiply by a scalar.
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
More information about the Digitalmars-d-learn