[Issue 12027] New: Range of true bits for std.bitmanip.BitArray

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Jan 29 08:24:13 PST 2014


https://d.puremagic.com/issues/show_bug.cgi?id=12027

           Summary: Range of true bits for std.bitmanip.BitArray
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: Phobos
        AssignedTo: nobody at puremagic.com
        ReportedBy: bearophile_hugs at eml.cc


--- Comment #0 from bearophile_hugs at eml.cc 2014-01-29 08:24:12 PST ---
std.bitmanip.BitArray is sometimes used to represent sparse sets. For this
usage it's handy to be able to iterate only on the bits set to true. So I
suggest to add a method that returns a range that yields the indexes of only
the true bits. Probably it's not hard to create such range using std.range and
std.algorithm, but a range implemented natively inside BitArray is probably
faster (it can skip whole empty words, and skip the empty bits faster).

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list