Bitfields in D
test123
test123 at gmail.com
Tue Oct 18 04:37:19 UTC 2022
On Tuesday, 18 October 2022 at 03:04:52 UTC, Dave P. wrote:
> [Adding bitfields to
> D](https://dlang.org/changelog/2.101.0.html#dmd.bitfields) for
> C interop is nice as it will automatically match the platform’s
> ABI for bitfields, but I don’t understand why we would want the
> implementation defined nightmare for regular D bitfields. One
> of the most annoying things about C bitfields is that if you
> use them, you can’t just write your structs to disk or across
> the network as your format is immediately non-portable across
> different systems. That sucks as that’s exactly when you would
> want to save space with bitfields. Native D bitfields should
> avoid this problem.
>
> [...]
With d CTFE reflection, this is easy to workaround.
More information about the Digitalmars-d
mailing list