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

Pushing lambdas to thread pool #15

Open
RaghuDV15 opened this issue Jan 31, 2018 · 1 comment
Open

Pushing lambdas to thread pool #15

RaghuDV15 opened this issue Jan 31, 2018 · 1 comment

Comments

@RaghuDV15
Copy link

TimerTask.cc: In lambda function:
TimerTask.cc:93:38: error: no matching function for call to ‘ctpl::thread_pool::push(TimerTask::TimerTask()::__lambda8::__lambda10)’
pool.push( { sleep(10); });
^
TimerTask.cc:93:38: note: candidates are:
In file included from TimerTask.cc:16:0:
ctpl.h:152:14: note: template<class F, class ... Rest> std::future<decltype (f(0, ctpl::thread_pool::push::rest ...))> ctpl::thread_pool::push(F&&, Rest&& ...)
auto push(F && f, Rest&&... rest) ->std::future<decltype(f(0, rest...))> {
^
ctpl.h:152:14: note: template argument deduction/substitution failed:
ctpl.h: In substitution of ‘template<class F, class ... Rest> std::future<decltype (f(0, ctpl::thread_pool::push::rest ...))> ctpl::thread_pool::push(F&&, Rest&& ...) [with F = TimerTask::TimerTask()::__lambda8::__lambda10; Rest = {}]’:
TimerTask.cc:93:38: required from here
ctpl.h:152:78: error: no match for call to ‘(TimerTask::TimerTask()::__lambda8::__lambda10) (int)’
auto push(F && f, Rest&&... rest) ->std::future<decltype(f(0, rest...))> {
^
TimerTask.cc:93:20: note: candidates are:
pool.push( { sleep(10); });
^
In file included from TimerTask.cc:16:0:
ctpl.h:152:78: note: void ()()
auto push(F && f, Rest&&... rest) ->std::future<decltype(f(0, rest...))> {
^
ctpl.h:152:78: note: candidate expects 1 argument, 2 provided
TimerTask.cc:93:22: note: TimerTask::TimerTask()::__lambda8::__lambda10
pool.push( { sleep(10); });
^
TimerTask.cc:93:22: note: candidate expects 0 arguments, 1 provided
In file included from TimerTask.cc:16:0:
ctpl.h:171:14: note: template std::future<decltype (f(0))> ctpl::thread_pool::push(F&&)
auto push(F && f) ->std::future<decltype(f(0))> {
^
ctpl.h:171:14: note: template argument deduction/substitution failed:
ctpl.h: In substitution of ‘template std::future<decltype (f(0))> ctpl::thread_pool::push(F&&) [with F = TimerTask::TimerTask()::__lambda8::__lambda10]’:
TimerTask.cc:93:38: required from here
ctpl.h:171:53: error: no match for call to ‘(TimerTask::TimerTask()::__lambda8::__lambda10) (int)’
auto push(F && f) ->std::future<decltype(f(0))> {
^
TimerTask.cc:93:20: note: candidates are:
pool.push( { sleep(10); });
^
In file included from TimerTask.cc:16:0:
ctpl.h:171:53: note: void (
)()
auto push(F && f) ->std::future<decltype(f(0))> {
^
ctpl.h:171:53: note: candidate expects 1 argument, 2 provided
TimerTask.cc:93:22: note: TimerTask::TimerTask()::__lambda8::__lambda10
pool.push( { sleep(10); });
^
TimerTask.cc:93:22: note: candidate expects 0 arguments, 1 provided

@ihowell
Copy link

ihowell commented Jul 13, 2019

Care to provide source?

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