[Issue 18133] BitArray prints bits in wrong order
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Thu Feb 1 23:02:50 UTC 2018
https://issues.dlang.org/show_bug.cgi?id=18133
Jakub Łabaj <uaaabbjjkl at gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |uaaabbjjkl at gmail.com
--- Comment #2 from Jakub Łabaj <uaaabbjjkl at gmail.com> ---
Personally, I wouldn't say it's a bug - this particular constructor takes a raw
data that is mapped onto the content of the BitArray. This is consistent (i.e.
is exactly the opposite) with the cast operator to `void[]`:
size_t val = 0b11001111_11010010;
void[] arr = [val];
auto ba = BitArray([val], 16);
assert(cast(void[]) ba == [val]);
Definitely, there should be a note in the doc saying it works in that way - I'm
going to add it.
--
More information about the Digitalmars-d-bugs
mailing list