www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Re: rtti cast

reply terranium <spam here.lot> writes:
BCS Wrote:

 Thinking about it, I can't recall ever casting to a derived type where a 
 failed cast was an indication of a bug.

 a little sugar for the other way might be even handier

May 08 2008
parent BCS <ao pathlink.com> writes:
Reply to terranium,

 BCS Wrote:
 
 Thinking about it, I can't recall ever casting to a derived type
 where a failed cast was an indication of a bug.
 


Ok, some some people use then one way, I use them another. That doesn't prove that they your proposal is better (or worse) than the current way.
 When a function receives unexpected input it's
 a bug.
 

That's irrelevant. What I'm saying is that in every case I know of where I have used such a cast, the cast failing was /not/ unexpected. It was mealy a legitimate and /expected/ "no" answer to the question "is a's type B?"
May 08 2008