www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - opCast and implicit casting

reply Nils Hensel <nils.hensel web.de> writes:
Hi group,

I have always wondered why implicit casting is disallowed even when a 
class has opCast defined for this cast's type? Isn't it obvious through 
the l-value alone? Why explicit?

Regards,
Nils
May 16 2006
parent "Jarrett Billingsley" <kb3ctd2 yahoo.com> writes:
"Nils Hensel" <nils.hensel web.de> wrote in message 
news:e4bu98$1mq6$1 digitaldaemon.com...

 I have always wondered why implicit casting is disallowed even when a 
 class has opCast defined for this cast's type? Isn't it obvious through 
 the l-value alone? Why explicit?
Because Walter thinks that implicit non-trivial casts are a Bad Thing (TM) (and in most cases, I'm inclined to agree).
May 16 2006