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


##########
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.
   
   I'm not sure what you mean here. `G&&` is a [forwarding 
reference](https://en.cppreference.com/w/cpp/language/reference#Forwarding_references)
 according to the C++ reference.
   
   > This is how predicates are passed to functions like `find_if` in the 
standard library.
   
   Is this the actual declaration in a standard library implementation, or the 
abstract signature as shown in the reference?
   (also, since `find_if` typically calls the predicate several times, it can 
probably not `std::forward` it)
   



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