rtti cast

BCS BCS at pathlink.com
Fri May 2 11:27:44 PDT 2008


terranium wrote:
> Pragma Wrote:
> 
> 
>>If you absolutely need an exception
> 
> 
> And who don't? Yet another D misdesign to be worked around? 
 > And where will be more legacy design typos in the end? In
 > C++ or in D?

In most cases forgetting to check the cast return will result in an 
seg-v from a dereferenced null because you almost always use it as the 
very next thing. Also it will never result in a miss use for the same 
reason, the pointer doesn't point to anything.

Having the "bad cast" -> null is very handy when you don't known if the 
cast will be good. It mean you can test it without invoking the 
exception system and all the overhead that entails.



More information about the Digitalmars-d mailing list