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

Dennis Ritchie via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun May 3 10:34:49 PDT 2015


On Sunday, 3 May 2015 at 14:49:55 UTC, Martin Nowak wrote:
> 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/

Thank you. This should help.


More information about the Digitalmars-d-learn mailing list