Can we just have struct inheritence already?

12345swordy alexanderheistermann at gmail.com
Fri Jun 14 01:06:35 UTC 2019


On Thursday, 13 June 2019 at 23:28:37 UTC, Manu wrote:
> On Thu, Jun 13, 2019 at 4:05 PM 12345swordy via Digitalmars-d 
> <digitalmars-d at puremagic.com> wrote:
>>
>> On Thursday, 13 June 2019 at 22:12:37 UTC, Manu wrote:
>> > On Thu, Jun 13, 2019 at 7:55 AM 12345swordy via 
>> > Digitalmars-d <digitalmars-d at puremagic.com> wrote:
>> >>
>> >> > [...] It's not better.
>> >>
>> >> Wouldn't it be better to allow structs to implement static 
>> >> only interfaces?
>> >
>> > I don't know what that means? Like D `interface`, which is a 
>> > pure vtable with no data members? That's the opposite of 
>> > what I want... what is a 'static' interface?
>>
>> Interface with only static functions and data members. No 
>> virtual function what so ever.
>
> Well... right. We're talking about struct's here. struct's 
> don't have virtual functions.
I am saying that structs should be allow to inherent interfaces, 
provided that said interface only contains statics functions(with 
or without implementation) or data members.

What you want is the ability to define a contract for the structs 
to inherited without any virtual functions.



More information about the Digitalmars-d mailing list