Array of BitArrays definition compiles in DMD but not in GDC.

TheGag96 via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Oct 9 08:44:52 PDT 2015


On Friday, 9 October 2015 at 07:08:15 UTC, John Colvin wrote:
> On Thursday, 8 October 2015 at 21:40:02 UTC, TheGag96 wrote:
>> [...]
>
> gdc is a bit out of date at the moment. If you do something 
> like this:
>
> auto bitArray(bool[] ba) pure nothrow
> {
>     BitArray tmp;
>     tmp.init(ba);
>     return tmp;
> }
>
> auto bitArray(void[] v, size_t numbits) pure nothrow
> {
>     BitArray tmp;
>     tmp.init(v, numbits);
>     return tmp;
> }
>
> then replace all your calls to the constructor BitArray with 
> bitArray, things should work OK for you.

That appears to work, although the compiler was complaining that 
the calls to init were not pure nor nothrow. Thanks! Hopefully 
they'll update GDC soon.


More information about the Digitalmars-d-learn mailing list