Is it time to deprecate COM compatibility through D interfaces?
Fawzi Mohamed
fawzi at gmx.ch
Wed Apr 14 07:42:11 PDT 2010
On 14-apr-10, at 16:08, Steven Schveighoffer wrote:
> On Wed, 14 Apr 2010 09:34:38 -0400, Fawzi Mohamed <fawzi at gmx.ch>
> wrote:
>
>>> On Wed, 14 Apr 2010 08:22:59 -0400, Jason House <jason.james.house at gmail.com
>>> > wrote:
>>>
>>>> Don suggested defining them the same way as C++ classes.
>>>
>> I like this, implicit casting to object would be very convenient,
>> but note that that precludes the possibility of ever having structs
>> implement interfaces (not that they should, but as of now it is
>> kind of possible to imagine).
>
> I don't think this will ever happen. Since D is moving towards
> outlawing referencing stack data in safeD, this would mean struct
> interfaces are most likely illegal in safeD.
>
> Add to this the fact that then structs need a vtable, and you have
> started to stray from some of the benefits of structs. I just don't
> see it being worth it. And I did want struct interfaces too.
>
> We always have compile-time interfaces for structs (i.e. template
> constraints) that also work on classes.
it makes sense, I wanted just to point out the consequence, so that
this a design decision is done being aware of that.
More information about the Digitalmars-d
mailing list