Safer casts

BCS ao at pathlink.com
Sat May 10 12:38:35 PDT 2008


Reply to terranium,

> BCS Wrote:
> 
>> The major issue I have with this is that the construct that actually
>> does the downcast MUST also do the type check. Therefor it gets done
>> twice and this is  a bit of a performance issue.
>> 
> current implementation of cast already does the typecheck, so there
> will be no performance issue.
> 

but the proposal would requier *two* checks in the "use this as a B if it's 
a B" case. One for the code to "if" on and one in the actual conversion (to 
be safe).





More information about the Digitalmars-d mailing list