felipecrv commented on code in PR #33912:
URL: https://github.com/apache/arrow/pull/33912#discussion_r1091129026


##########
cpp/src/arrow/result.h:
##########
@@ -371,7 +371,7 @@ class [[nodiscard]] Result : public 
util::EqualityComparable<Result<T>> {
     if (ok()) {

Review Comment:
   Additionally, I don't think this should be `G&&` as the intention here is to 
let the compiler not even materialize `G` (e.g. by allocating an object on the 
stack and calling some constructor for `G`), but instead just splice the code 
from the lambda into the inlined code for this function.
   
   This is how predicates are passed to functions like `find_if` in the 
standard library.
   
   ```cpp
   template< class InputIt, class UnaryPredicate >
   constexpr InputIt find_if( InputIt first, InputIt last, UnaryPredicate p );
   ```



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