DIP: add Bit Fields

Walter Bright newshound2 at digitalmars.com
Tue Apr 23 00:38:47 UTC 2024


On 4/22/2024 10:28 AM, Richard (Rikki) Andrew Cattermole wrote:
> If you work with file formats, IPC (sockets, pipes ext.), CPU flags for embedded 
> devices, or performing instruction encoding for fun, you'll end up dealing with 
> this stuff heavily enough that you want language support.

std.bitmanip.bitfields are the appropriate solution for that.

BTW, the backend does a lot of instruction encoding :-)

I'd prefer it was written using bitfields, it would make the code more readable. 
I'm sure I wouldn't have any difficulty using C bitfields for it. I'm sure you 
wouldn't, either.


More information about the dip.development mailing list