24-bit int

Mike Parker via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat Sep 2 01:07:41 PDT 2017


On Saturday, 2 September 2017 at 07:20:07 UTC, kinke wrote:

> struct int24 {
>     ubyte[3] _payload;
> }
>
> static assert(int24.sizeof == 3);
> static assert(int24.alignof == 1);
>
> Making absolute sense. ubytes don't need any specific alignment 
> to be read efficiently.

Yes, that does make sense. It doesn't make sense that I didn't 
realize it.


More information about the Digitalmars-d-learn mailing list