We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The text was updated successfully, but these errors were encountered:
是不带参数的,你可以用std::bind或者lambda捕获局部变量来传入参数。
Sorry, something went wrong.
#include <hipe/hipe.h> double func(double x) { hipe::util::print("hello world"); return x; } int main() { hipe::SteadyThreadPond poo(10); auto tmp = poo.submitForReturn(std::bind(func, 2.5)); poo.waitForTasks(); hipe::util::print(tmp.get()); }
没问题呀
jack@LAPTOP-9HN8DLAB:~/code/Hipe/interfaces$ g++ tmp.cc -I ../include -lpthread && ./a.out hello world 2.5
No branches or pull requests
![截屏2023-04-07 00 47 09](https://user-images.githubusercontent.com/82711299/230444012-fa7cc8cf-e306-4c0c-873f-cd3b98aa8cf4.png)
如题,可以看出这个函数是不是只实现了 执行不带参数的函数功能啊?因为在调用std::result_of和std::packaged_task的时候,模板里面都没加参数的类型。如果我理解错误的话,up方不方便给一个普通函数的例子啊?The text was updated successfully, but these errors were encountered: