Can we just have struct inheritence already?

Walter Bright newshound2 at digitalmars.com
Mon Jun 10 03:08:26 UTC 2019


On 6/9/2019 12:40 PM, Vladimir Panteleev wrote:
> Structs are always at least 1 byte in size, even when they contain no fields. 
> This causes unnecessary bloat for reasons that I never understood.


The reason is so that each struct instance is at a unique address.

There are some rules in C++ where sometimes a struct with no fields occupies 1 
byte, sometimes 0 bytes. I don't recall what they are at the moment.


More information about the Digitalmars-d mailing list