Details
-
Task
-
Resolution: Fixed
-
P3: Somewhat important
-
None
-
None
-
1
-
c1a95d1d0 (dev), 47a028270 (dev), ba3225bab (6.5), a219503f1 (tqtc/lts-6.2), 14a2bd7ad (6.6), 7abb108f8 (tqtc/lts-5.15)
-
Foundation Sprint 87, Foundation Sprint 88
Description
Running a function returning void could often be a fire-and-forget scenario, or it may even emit signals later. So having QtConcurrent::run() marked nodiscard for all return-types means users must use Q_UNUSED (or its expanded from) to ignore the warning it produces.
void doThing(); ... QtConcurrent::run(doThing); // currently: warning of unused return value ... QFuture<void> future = QtConcurrent::run(doThing); // OK, but... Q_UNUSED(future); // ... it's unused