Details
-
Suggestion
-
Resolution: Fixed
-
P3: Somewhat important
-
6.4.3
-
None
-
c080d1e64 (dev), 0e7e1c339 (dev)
Description
QThreadPool::start() has an overload that takes a std::function. However, since std::function must be copyable, it's not possible to pass move-only lambdas. For example
FileDescriptor fd{42}; // FileDescriptor is move only QThreadPool::globalInstance()->start([fd = std::move(fd)]() mutable { // some work flush(std::move(fd)); // move the file descriptor ownership to flush() });
Attachments
For Gerrit Dashboard: QTBUG-112302 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
469144,17 | Take move-only functions for the threadpool | dev | qt/qtbase | Status: MERGED | +2 | 0 |
469351,10 | Create any callable using QRunnable::create | dev | qt/qtbase | Status: MERGED | +2 | 0 |