Ada to D - an array for storing values of each of the six bits which are sufficient

Martin Nowak via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun May 3 07:49:53 PDT 2015


On Friday, 1 May 2015 at 23:22:31 UTC, Dennis Ritchie wrote:
> Maybe someone will show a primitive packed array. I really can 
> not imagine how to do it on D.

Look at BitArray for an example 
https://github.com/D-Programming-Language/phobos/blob/12187d7be8b15b2f5f8ff6889cdb5ea3afb93dd1/std/bitmanip.d#L702.

Here is an implementation in C++ that could be easily adopted.
http://pempek.net/articles/2013/08/03/bit-packing-with-packedarray/


More information about the Digitalmars-d-learn mailing list