Tango BitArray Initialization
Bill Baxter
dnewsgroup at billbaxter.com
Sun Feb 11 23:52:29 PST 2007
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'".
--bb
More information about the Digitalmars-d-learn
mailing list