Bitfields
Russel Winder
russel at winder.org.uk
Wed May 22 08:48:39 UTC 2019
On Tue, 2019-05-21 at 18:22 +0000, Boris-Barboris via Digitalmars-d-learn
wrote:
[…]
>
> Never used it myself, but BitArray with careful handling of
> endianess might fit your task.
>
> https://dlang.org/phobos/std_bitmanip.html#.BitArray.this.2
> https://dlang.org/phobos/std_bitmanip.html#.peek
I'll have to mull that one over. The incoming data is a sequence of bytes that
is treated as a bitfield. Although the standard says "big-endian" it is isn't
entirely clear how this relates to the bitfields, I guess I need to read the
standard more. :-(
I guess the question is whether BitArray can work with bytes rather than
size_t as elements of the backing array.
--
Russel.
===========================================
Dr Russel Winder t: +44 20 7585 2200
41 Buckmaster Road m: +44 7770 465 077
London SW11 1EN, UK w: www.russel.org.uk
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-learn/attachments/20190522/054663e4/attachment.sig>
More information about the Digitalmars-d-learn
mailing list