Can we just have struct inheritence already?

Walter Bright newshound2 at digitalmars.com
Mon Jun 10 04:47:48 UTC 2019


On 6/9/2019 1:05 AM, Manu wrote:
> I am really really tired of this pattern:

Is your real complaint this:
---
   #include <stdio.h>

   struct B { };
   struct S : B { char c; };
   struct T { B b; char c; };

   void main(){
     printf("%d %d\n", sizeof(struct S), sizeof(struct T));
   }
---
which prints:

   1 2

?


More information about the Digitalmars-d mailing list