Bug 1998 – std.bitarray should have setAll / opSliceAssign(bool) etc

Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2008-04-15T23:26:54Z
Last change time
2017-12-18T22:54:37Z
Keywords
bootcamp
Assigned to
No Owner
Creator
Bill Baxter

Comments

Comment #0 by wbaxter — 2008-04-15T23:26:54Z
There are a number of things that could enhance BitArray's functionality: * BitArray doesn't appear to have any way to set all bits to a given value efficiently. The D'ish way would be to provide an opSliceAssign(bool val) and then you could do bitarr[] = true; * It should probably support other slice operations as well, at least the basic opSlice, if not more general opSliceAssign. * Also missing I think is a way to flip the bits in place. If there were overloads for the numeric operators that did "broadcasting" then that would take care of it, because then you could do bitarr ^= true; to flip all the bits. By "broadcasting" I mean treat a single bool as if it were a BitArray containing that same bool value repeated N times.
Comment #1 by andrei — 2015-11-03T19:14:51Z
This applies to D2, marking it as such.
Comment #2 by razvan.nitu1305 — 2017-07-20T10:44:06Z
Comment #3 by github-bugzilla — 2017-10-30T10:49:45Z
Commits pushed to master at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/24080dfe95d9cb1fea86511e80c467be68bb7946 Fix Issue 1998 - std.bitarray should have setAll / opSliceAssign(bool) etc https://github.com/dlang/phobos/commit/876e4ccd0e3266974710f8cfb743dc3283ad774b Fix Issue 1998 - std.bitarray should have setAll / opSliceAssign https://github.com/dlang/phobos/commit/b147252785c994c26988268c7afaadbc2800405b Merge pull request #5634 from RazvanN7/Issue_1998 Fix Issue 1998 - std.bitarray should have setAll / opSliceAssign merged-on-behalf-of: Petar Kirov <[email protected]>
Comment #4 by github-bugzilla — 2017-12-18T22:54:37Z
Commits pushed to stable at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/24080dfe95d9cb1fea86511e80c467be68bb7946 Fix Issue 1998 - std.bitarray should have setAll / opSliceAssign(bool) etc https://github.com/dlang/phobos/commit/876e4ccd0e3266974710f8cfb743dc3283ad774b Fix Issue 1998 - std.bitarray should have setAll / opSliceAssign https://github.com/dlang/phobos/commit/b147252785c994c26988268c7afaadbc2800405b Merge pull request #5634 from RazvanN7/Issue_1998