Bit fields in struct, why doesn't D support them?

Jarrett Billingsley jarrett.billingsley at gmail.com
Tue May 19 20:28:41 PDT 2009


On Tue, May 19, 2009 at 11:17 PM, Jeremie Pelletier <jeremiep at gmail.com> wrote:
> I know this is an old subject, as this has been stated in the struct reference page ever since D1, but I'm really wondering why the bit fields aren't supported (or purposely not implemented?) in D.
>
> Having this feature would greatly simplify a lot of code, and allow easier interfacing with C structs using it.

It actually wouldn't, since C doesn't specify any order to packing
bitfields, whether there should be padding etc.



More information about the Digitalmars-d mailing list