joosthooz commented on pull request #12609:
URL: https://github.com/apache/arrow/pull/12609#issuecomment-1075070737


   So for Futures it is now working, thanks for the help. I've been trying to 
do the same for `Executor::Submit`, but haven't been successful so far. Here's 
what the compiler says:
   ```
   arrow/cpp/src/arrow/util/thread_pool.h:172:49: error: no matching function 
for call to ‘forward<arrow::fs::CopyFiles(const 
std::shared_ptr<arrow::fs::FileSystem>&, const arrow::fs::FileSelector&, const 
std::shared_ptr<arrow::fs::FileSystem>&, const string&, const 
arrow::io::IOContext&, int64_t, 
bool)::<lambda(int)>&>(arrow::internal::Executor::Submit(arrow::internal::TaskHints,
 arrow::StopToken, Function&&, Args&& ...) [with Function = 
arrow::fs::CopyFiles(const std::shared_ptr<arrow::fs::FileSystem>&, const 
arrow::fs::FileSelector&, const std::shared_ptr<arrow::fs::FileSystem>&, const 
string&, const arrow::io::IOContext&, int64_t, bool)::<lambda(int)>&; Args = 
{int&}; FutureType = arrow::Future<>]::<unnamed struct>&)’
     172 |                           std::forward<Function>(wrapper), 
std::forward<Args>(args)...);
         |                           ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~
   ...
   no known conversion for argument 1 from 
‘arrow::internal::Executor::Submit(arrow::internal::TaskHints, 
arrow::StopToken, Function&&, Args&& ...) [with Function = 
arrow::fs::CopyFiles(const std::shared_ptr<arrow::fs::FileSystem>&, const 
arrow::fs::FileSelector&, const std::shared_ptr<arrow::fs::FileSystem>&, const 
string&, const arrow::io::IOContext&, int64_t, bool)::<lambda(int)>&; Args = 
{int&}; FutureType = arrow::Future<>]::<unnamed struct>’ to 
‘std::remove_reference<arrow::fs::CopyFiles(const 
std::shared_ptr<arrow::fs::FileSystem>&, const arrow::fs::FileSelector&, const 
std::shared_ptr<arrow::fs::FileSystem>&, const string&, const 
arrow::io::IOContext&, int64_t, bool)::<lambda(int)>&>::type&’ {aka 
‘arrow::fs::CopyFiles(const std::shared_ptr<arrow::fs::FileSystem>&, const 
arrow::fs::FileSelector&, const std::shared_ptr<arrow::fs::FileSystem>&, const 
string&, const arrow::io::IOContext&, int64_t, bool)::<lambda(int)>&’}
   ```
   I tried using `std::function<void(Args&&...)>` instead of `forward`, then 
the error is:
   ```
   arrow/cpp/src/arrow/status.h:57:61: error: cannot convert 
‘std::remove_reference<std::_Bind<arrow::detail::ContinueFuture(arrow::Future<std::vector<arrow::fs::FileInfo>
 >, std::function<void(std::shared_ptr<arrow::fs::FileSystem>&&)>, 
std::shared_ptr<arrow::fs::FileSystem>)>&>::type’ {aka 
‘std::_Bind<arrow::detail::ContinueFuture(arrow::Future<std::vector<arrow::fs::FileInfo>
 >, std::function<void(std::shared_ptr<arrow::fs::FileSystem>&&)>, 
std::shared_ptr<arrow::fs::FileSystem>)>’} to ‘arrow::internal::FnOnce<void()>’
   ```


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