D should have a root interface

Bill Baxter wbaxter at gmail.com
Mon Jul 28 18:54:41 PDT 2008


On Tue, Jul 29, 2008 at 10:48 AM, Neil Vice <sardonicpresence at gmail.com>wrote:

>
> This would not break any code and helps to make the calling code less
>>> casty.
>>>
>>
>> Or, you know, just make all instances of interfaces that don't extend
>> IUnknown implicitly castable to object.
>>
>
> Can not structs implement interfaces? Should they be implicitly castable to
> Object?
>

No, structs cannot implement interfaces, and it makes no sense to cast a
struct to Object either implicitly or explicitly.

Structs in D are for representing value types and have no virtual methods or
inheritance.

--bb
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20080729/b065d48b/attachment.html>


More information about the Digitalmars-d mailing list