Why are std.bitmanip.bitfields so big ?

wjoe invalid at example.com
Tue Jul 28 09:28:27 UTC 2020


On Monday, 27 July 2020 at 12:52:53 UTC, Steven Schveighoffer 
wrote:
> 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

It was run on the doc page. I suppose the examples are wrapped in 
a unittest block?

Anyways, I appreciate your explanation.


More information about the Digitalmars-d-learn mailing list