Overloading opCast with multiple types
Jarrett Billingsley
kb3ctd2 at yahoo.com
Sun Oct 1 13:49:45 PDT 2006
"Kristian" <kjkilpi at gmail.com> wrote in message
news:op.tgq6xi1s5xlco7 at mist...
---------------------------------------------
Yep, I also prefer such functions over cast statements.
But if D would have implicit type conversion with multiple opCasts, then
you could just do "x = y;". Would this be a good thing?... I don't know.
(Surely it would be less informative, if nothing else.)
---------------------------------------------
(my newsreader does not like quoting your posts for some reason!)
Walter has expressed his.. disgust? Lack of support? for C++-style
implicit casts, and I agree with him to an extent. For trying to make
"value" types (such as a BigInteger class or something), not having implicit
casts can make it cumbersome to use the class, but to be honest, I've never
had to write such a type.
In any case, I wouldn't cross my fingers for anything like this to happen
soon ;)
More information about the Digitalmars-d
mailing list