diff --git a/lib/include/srslte/common/multiqueue.h b/lib/include/srslte/common/multiqueue.h index 83cfbe998..560270efb 100644 --- a/lib/include/srslte/common/multiqueue.h +++ b/lib/include/srslte/common/multiqueue.h @@ -240,10 +240,10 @@ public: { } template - moveable_task_t(Func&& f, Capture&& c) : - func([this, f]() { f(std::move(capture)); }), - capture(std::forward(c)) + moveable_task_t(Func&& f, Capture&& c) : capture(std::forward(c)) { + std::function ftmp{std::forward(f)}; + func = [this, ftmp]() { ftmp(std::move(capture)); }; } void operator()() { func(); }