inout foreach on BitArrays

Deewiant deewiant.doesnotlike.spam at gmail.com
Thu Mar 2 10:11:36 PST 2006


xs0 wrote:
> I think it's a bug, too - looking at the source of BitArray, it would
> seem that the new value does not get written back to the storage, even
> though it should..
> 
> 
> xs0

I agree, I think the problem lies in the fact that the bit retrieved is a copy
got by calling opIndex(i). It'd probably be easiest to just call
opIndexAssign(i, b) afterward, but it might also be possible to somehow pass the
bit itself directly.

Since part of BitArray is done with std.intrinsic and particularly in opIndex we
have the functions bt(), bts() and btr() whose implementations are unavailable,
I can't really say whether the latter is possible in any reasonable way.



More information about the Digitalmars-d-bugs mailing list