Why are std.bitmanip.bitfields so big ?

Steven Schveighoffer schveiguy at gmail.com
Mon Jul 27 12:52:53 UTC 2020


On 7/27/20 5:49 AM, wjoe wrote:
> struct A
> {
>      mixin(bitfields!(
>         bool, "flag1",    1,
>         bool, "flag2",    1,
>         uint, "",         6));
> }

Is this inside a function? If so, put `static` on it.

What you are seeing is the 8-byte frame pointer that comes from inner 
structs so you can access stack variables inside the struct.

-Steve


More information about the Digitalmars-d-learn mailing list