Can we just have struct inheritence already?

Ola Fosheim Grøstad ola.fosheim.grostad at gmail.com
Sun Jun 9 11:31:46 UTC 2019


On Sunday, 9 June 2019 at 08:39:09 UTC, Mike Parker wrote:
> On Sunday, 9 June 2019 at 08:19:46 UTC, KnightMare wrote:
>
>>
>> what is the problem not doing this?
>> copying is not to difficult: blit and call postblit for all 
>> members if they have it.
>> what the problem i forgot?
>
> Object slicing. It's a problem with inherited types when passed 
> by value.
>
> https://stackoverflow.com/questions/274626/what-is-object-slicing#274636

Use private inheritance of base class.



More information about the Digitalmars-d mailing list