Why must butfields sum to a multiple of a byte?

Ali Çehreli acehreli at yahoo.com
Mon Jul 30 10:43:28 PDT 2012


On 07/30/2012 10:15 AM, Andrej Mitrovic wrote:

 > import std.bitmanip;
 > struct Foo
 > {
 >      mixin(bitfields!(
 >          uint, "bits1", 32,
 >      ));
 > }
 >
 > D:\DMD\dmd2\windows\bin\..\..\src\phobos\std\bitmanip.d(76): Error:
 > shift by 32 is outside the range 0..31
 >
 > Should I file this?

Yes, it's a bug.

Ali



More information about the Digitalmars-d-learn mailing list