pitrou opened a new issue, #51289:
URL: https://github.com/apache/arrow/issues/51289

   ### Describe the enhancement requested
   
   `VisitBitRuns`, `VisitSetBitRuns`, `VisitTwoSetBitRuns` are useful in many 
cases but some times the caller needs to control the control flow, for example 
for returning early.
   
   So it would be nice to be able to write:
   ```c++
     for (const auto run : IterateBitRuns(bitmap, offset, length)) {
       // do something with run.position, run.length, run.set
     }
     // or:
     for (const auto run : IterateSetBitRuns(bitmap, offset, length)) {
       // do something with run.position, run.length
     }
     // or:
     for (const auto run : IterateTwoSetBitRuns(
         left_bitmap, left_offset, right_bitmap, right_offset, length)) {
       // do something with run.position, run.length
     }
   ```
   
   The same transformation could be done for `VisitBitBlocks`, 
`VisitTwoBitBlocks`.
   
   ### Component(s)
   
   C++


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to