Opened 5 years ago
Last modified 5 years ago
#13520 new Bugs
Cant add capture-by-move lambda to channel
| Reported by: | Owned by: | olli | |
|---|---|---|---|
| Milestone: | To Be Determined | Component: | context |
| Version: | Boost 1.66.0 | Severity: | Not Applicable |
| Keywords: | fibers | Cc: |
Description
The following code isnt working if the test is move-only
using task = std::function<void()>;
boost::fibers::buffered_channel<task> ch{1024};
test tst;
ch.push([t{std::move(tst)}]() { t.print(); });
Full repro: http://coliru.stacked-crooked.com/a/88dec3ea76a41ea1
Change History (2)
comment:1 by , 5 years ago
comment:2 by , 5 years ago
| Severity: | Problem → Not Applicable |
|---|
Note:
See TracTickets
for help on using tickets.

I retract my claim. I forgot (again) that std::function must be copyable and copyconstructible. The problem is in the std::function stored in the channel and not the channel itself