Tango BitArray Initialization

Sean Kelly sean at f4.ca
Mon Feb 12 00:35:55 PST 2007


Bill Baxter wrote:
> John Reimer wrote:
>> On Sun, 11 Feb 2007 19:41:48 -0800, Sean Kelly wrote:
>>
> 
>> Another simple alternative could employ a static opAssign.
>>
>> This would make things much simpler:
>>
>> BitArray bitbag = 0b11111000000;
>>
>> The value is limited to 64-bits, but at least it's clean and simple for
>> those situations where we don't have a long initialization value.
>> (this would work for hexidecimal value also).  For any larger values we
>> can use an array literal assignment or something similar.
>>
> 
> Does opAssign work that way?  I think it has to be done in two lines:
> 
>  BitArray bitbag;
>  bitbag = 0b11111000000;
> 
> Yes that does seem to be the case.  Otherwise you get, bizarrely, the 
> error "no property 'opCall' for type 'Foo'".

Oddly, if you make the opCall static, it works.


Sean


More information about the Digitalmars-d-learn mailing list