HuaHuaY commented on code in PR #51310:
URL: https://github.com/apache/arrow/pull/51310#discussion_r4013307780


##########
cpp/src/arrow/util/bit_run_reader.h:
##########
@@ -466,6 +468,386 @@ inline uint64_t 
BaseSetBitRunReader<true>::ConsumeBits(uint64_t word, int32_t nu
 using SetBitRunReader = BaseSetBitRunReader</*Reverse=*/false>;
 using ReverseSetBitRunReader = BaseSetBitRunReader</*Reverse=*/true>;
 
+struct PositionedBitRun {
+  int64_t position;
+  int64_t length;
+  bool set;
+
+  std::string ToString() const {
+    return std::string("{pos=") + std::to_string(position) +
+           ", len=" + std::to_string(length) + ", set=" + std::to_string(set) 
+ "}";
+  }
+};
+
+inline bool operator==(const PositionedBitRun& lhs, const PositionedBitRun& 
rhs) {

Review Comment:
   I think we may be able to add `bool operator==(const PositionedBitRun&) 
const = default;` in the struct definition and don't need to add the two 
functions. C++20 supports `=default` for `operator==` and automatically 
generates `operator!=` when `operator==` is defined (though I am not sure if 
all our CI compilers support this yet).



-- 
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