Templated Interfaces?
Benji Smith
dlanguage at benjismith.net
Sun Aug 24 15:38:19 PDT 2008
Jarrett Billingsley wrote:
> "Jason House" <jason.james.house at gmail.com> wrote in message
> news:g8sioq$6ul$1 at digitalmars.com...
>
>> whoa, that's a bad idea!
>>
>> You can not implicitly cast back and forth between interfaces and classes
>> that implement those interfaces; the underlying pointer is not the same.
>> There was a big discussion about this fairly recently on one of the D
>> mailing lists...
>
> No, what he's doing is OK. The trouble only occurs when you try to cast
> *the array* up or down the inheritance hierarchy.
Yeah, with the code I'm currently working on, once the objects are in
the array, I never again care what the specific class is for each
instance, since I'll only be calling the interface methods.
--benji
More information about the Digitalmars-d-learn
mailing list