edponce commented on a change in pull request #11882:
URL: https://github.com/apache/arrow/pull/11882#discussion_r776638260



##########
File path: cpp/src/arrow/util/bit_block_counter.h
##########
@@ -87,6 +87,147 @@ struct BitBlockOrNot<bool> {
   static bool Call(bool left, bool right) { return left || !right; }
 };
 
+// Three Arguments
+template <typename T>
+struct BitBlockAndAnd {
+  static T Call(T left, T mid, T right) { return left & mid & right; }
+};
+
+template <>
+struct BitBlockAndAnd<bool> {
+  static bool Call(bool left, bool mid, bool right) { return left && mid && 
right; }

Review comment:
       There is no need to specialize all these bitwise operations for `bool` 
as the language guarantees that for boolean types: `(bool)(a & b) == a && b`. 
Note the explicit cast which corresponds to the return type `T` in these 
functions. This simplification also applies to the existing binary bitwise 
operations, we can resolve this ARROW-15220.




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