May 08, 2008
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.
You can't, others can. When a function receives unexpected input it's a bug.

> a little sugar for the other way might be even handier
making default behavior unsafe is a wrong way.
May 08, 2008
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.
>> 
> You can't, others can.

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?"