Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

ArraySeq of BitArrays

Moderators: kris

Posted: 01/11/08 13:12:27

Hi,

I am currently trying to figure out how to correctly use a ArraySeq? of BitArray? objects. This simple test program

import tango.core.BitArray,
		tango.io.Stdout,
	tango.util.collection.ArraySeq;


int main( char[][]args ) {
	ArraySeq!(BitArray) bs = new ArraySeq!(BitArray);

	return 0;
}

gives a compiler error

/home/sim/gdc/include/tango/util/collection/ArraySeq.d:491: function tango.core.BitArray.BitArray.init (void[],uint) does not match parameter types ()
/home/sim/gdc/include/tango/util/collection/ArraySeq.d:491: Error: this for init needs to be type BitArray not type tango.util.collection.ArraySeq.ArraySeq!(BitArray ).ArraySeq
/home/sim/gdc/include/tango/util/collection/ArraySeq.d:491: class tango.util.collection.ArraySeq.ArraySeq!(BitArray ).ArraySeq member init is not accessible
/home/sim/gdc/include/tango/util/collection/ArraySeq.d:491: Error: expected 2 arguments, not 0
/home/sim/gdc/include/tango/util/collection/ArraySeq.d:491: function tango.core.BitArray.BitArray.opAssign (bool[]) does not match parameter types (void)
/home/sim/gdc/include/tango/util/collection/ArraySeq.d:491: Error: cannot implicitly convert expression ((this.init)()) of type void to bool[]
/home/sim/gdc/include/tango/util/collection/ArraySeq.d:522: function tango.core.BitArray.BitArray.init (void[],uint) does not match parameter types ()
/home/sim/gdc/include/tango/util/collection/ArraySeq.d:522: Error: this for init needs to be type BitArray not type tango.util.collection.ArraySeq.ArraySeq!(BitArray ).ArraySeq
/home/sim/gdc/include/tango/util/collection/ArraySeq.d:522: class tango.util.collection.ArraySeq.ArraySeq!(BitArray ).ArraySeq member init is not accessible
/home/sim/gdc/include/tango/util/collection/ArraySeq.d:522: Error: expected 2 arguments, not 0
/home/sim/gdc/include/tango/util/collection/ArraySeq.d:522: function tango.core.BitArray.BitArray.opAssign (bool[]) does not match parameter types (void)
/home/sim/gdc/include/tango/util/collection/ArraySeq.d:522: Error: cannot implicitly convert expression ((this.init)()) of type void to bool[]
/home/sim/gdc/include/tango/util/collection/ArraySeq.d:592: function tango.core.BitArray.BitArray.init (void[],uint) does not match parameter types ()
/home/sim/gdc/include/tango/util/collection/ArraySeq.d:592: Error: this for init needs to be type BitArray not type tango.util.collection.ArraySeq.ArraySeq!(BitArray ).ArraySeq
/home/sim/gdc/include/tango/util/collection/ArraySeq.d:592: class tango.util.collection.ArraySeq.ArraySeq!(BitArray ).ArraySeq member init is not accessible
/home/sim/gdc/include/tango/util/collection/ArraySeq.d:592: Error: expected 2 arguments, not 0
/home/sim/gdc/include/tango/util/collection/ArraySeq.d:592: function tango.core.BitArray.BitArray.opAssign (bool[]) does not match parameter types (void)
/home/sim/gdc/include/tango/util/collection/ArraySeq.d:592: Error: cannot implicitly convert expression ((this.init)()) of type void to bool[]

as far a I have figured it out, this is caused by BitArray?'s void init (void[] v, uint numbits) method overriding some default init method. But I'm new to d programming and do not quite understand the object allocation/initialization stuff (e.g. what this init thing in ArraySeq?.d:491 is...). So what is going on, or is it just plain wrong, what I am doing here? The version of tango is 0.99.4 on gdc.

thanks, Simon.

There are no responses to display.