Struct inheritance

Derek Fawcus dfawcus+dlang at employees.org
Fri Dec 6 13:48:42 UTC 2024


On Friday, 6 December 2024 at 12:21:02 UTC, claptrap wrote:
> On Friday, 6 December 2024 at 00:06:12 UTC, Jonathan M Davis 
> wrote:
>> On Thursday, December 5, 2024 4:36:17 PM MST Derek Fawcus via
>>>
>>> Is that correct?
>>
>> The types would be completely independent from one another. It 
>> would just be a way to copy the implementation from one to the 
>> other.
>
> Yay! This will be the new "private is not private" topic. I 
> expect a deluge of ****posting complaining that struct 
> inheritance is not inheritance.

Then maybe don't refer to it as "struct inheritance", possibly 
use something like "struct inclusion", or "struct addition".  
Plus maybe a different syntax, e.g.:

```d
struct A {
}

struct B += A {
}
```


More information about the dip.ideas mailing list