Closed dpuyda closed 4 months ago
Note that it also doesn't compile with an ordinary std::queue
:
std::queue<std::function<void()>> queue;
auto foo = std::make_unique<int>();
queue.emplace([foo = std::move(foo)] {});
A problem here is that std::function
requires the argument to be copy-constructible. Found a few explanations:
The following code snippet does not compile: