You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In file included from /usr/gcc_toolchain/lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/functional:59:
/usr/gcc_toolchain/lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/bits/std_function.h:176:10: error: call to implicitly-deleted copy constructor of '(lambda at .../test.cc:7:18)'
new _Functor(*__source._M_access<const _Functor*>());
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/gcc_toolchain/lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/bits/std_function.h:211:8: note: in instantiation of member function 'std::_Function_base::_Base_manager<(lambda at .../test.cc:7:18)>::_M_clone' requested here
_M_clone(__dest, __source, _Local_storage());
^
/usr/gcc_toolchain/lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/bits/std_function.h:677:33: note: in instantiation of member function 'std::_Function_base::_Base_manager<(lambda at .../test.cc:7:18)>::_M_manager' requested here
_M_manager = &_My_handler::_M_manager;
^
external/marl/include/marl/scheduler.h:534:27: note: in instantiation of function template specialization 'std::function<void ()>::function<(lambda at .../test.cc:7:18), void, void>' requested here
scheduler->enqueue(Task(std::forward<Function>(f)));
^
...test.cc:7:9: note: in instantiation of function template specialization 'marl::schedule<(lambda at .../test.cc:7:18)>' requested here
marl::schedule([=, input = std::move(input)] {
^
.../test.cc:7:22: note: copy constructor of '' is implicitly deleted because field '' has a deleted copy constructor
marl::schedule([=, input = std::move(input)] {
^
/usr/gcc_toolchain/lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/bits/unique_ptr.h:414:7: note: 'unique_ptr' has been explicitly marked deleted here
unique_ptr(const unique_ptr&) = delete;
^
1 error generated.
The std::thread() lambda can take unique_ptr though. Any ideas? Thanks.
The text was updated successfully, but these errors were encountered:
123qws
changed the title
can't pass unique_ptr to marl::schedule lambda
Can't pass unique_ptr to marl::schedule lambda
Jan 26, 2022
123qws
changed the title
Can't pass unique_ptr to marl::schedule lambda
Can't capture unique_ptr in marl::schedule lambda
Jan 26, 2022
Here's a simple example:
I got the following compile error:
The std::thread() lambda can take unique_ptr though. Any ideas? Thanks.
The text was updated successfully, but these errors were encountered: