You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/02/17 12:30:50 UTC

[GitHub] [arrow] pitrou commented on a change in pull request #12448: ARROW-15700: [C++] Compilation error on Ubuntu 18.04

pitrou commented on a change in pull request #12448:
URL: https://github.com/apache/arrow/pull/12448#discussion_r808997942



##########
File path: cpp/src/arrow/engine/substrait/expression_internal.cc
##########
@@ -443,8 +443,11 @@ struct ScalarToProtoImpl {
     return Status::OK();
   }
 
+  // Note: while std::string&& would be better for the argument
+  // type, older versions of protobuf don't have this overload
+  // yet.
   template <typename ScalarWithBufferValue>
-  Status FromBuffer(void (substrait::Expression::Literal::*set)(std::string&&),
+  Status FromBuffer(void (substrait::Expression::Literal::*set)(const std::string&),

Review comment:
       You could also take a lambda and let C++ resolve the best overload there:
   ```c++
     template <typename LitteralSetter>
     Status FromBuffer(LitteralSetter&& set_lit,
                       const ScalarWithBufferValue& scalar_with_buffer) {
       set_lit(lit_, scalar_with_buffer.value->ToString());
       return Status::OK();
     }
   
     Status Visit(const StringScalar& s) {
       return FromBuffer([](Lit* lit, std::string s) { lit->set_string(std::move(s)); });
     }
   ```




-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org