Skip to content
New issue

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

关于 auto task = std::make_shared<std::packaged_task<ResType()>>(std::bind(std::forward<F>(f), std::forward<Args>(args)...) ); #23

Open
lizhuo111 opened this issue Jul 13, 2022 · 1 comment

Comments

@lizhuo111
Copy link

有两个问题想请教:1.有没有别的写法
2.我使用的方法为:std::packaged_task<ResType()>task(forward(f), std::forward(args)...) ); 就是没给makeshared 为什么会报错呢

@lzpong
Copy link
Owner

lzpong commented Feb 8, 2023

什么错, 你的对象销毁了? makeshare 是制造引用

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants