Union with bits ?

Adam D Ruppe destructionator at gmail.com
Wed Jun 14 11:13:10 UTC 2023


On Wednesday, 14 June 2023 at 08:51:19 UTC, Rene Zwanenburg wrote:
> You can do something like this if you don't mind compiling with 
> -preview=bitfields:

That doesn't do what you think it does. There's no guarantee the 
bits will actually line up with the status byte.

The best way to do what the OP wants is to add property getters 
and setters to the struct with the ubyte that masks the member.


More information about the Digitalmars-d-learn mailing list