-
Bug
-
Resolution: Fixed
-
P2: Important
-
6.9.2
-
None
-
0f20882c4 (dev), f247a3d59 (6.10)
The documentation says any QFuture<T> can be assigned to QFuture<void> and while this works in an explicit assignment, it does not when an argument expect QFuture<void> because the constructor that takes a QFuture<T> and build a QFuture<void> is explicit:
template<typename U, typename V = T, typename = QtPrivate::EnableForVoid<V>>
explicit QFuture(const QFuture<U> &other) : d(other.d)
{
}
Attached is a test case, uncomment line 34 to see the error:
qfuture/main.cpp:34:23: error: invalid initialization of reference of type ‘const QFuture<void>&’ from expression of type ‘QFuture<long long int>’ 34 | debugProgress(future); // fails to compile
For Gerrit Dashboard: QTBUG-139790 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
678042,1 | QFuture: allow implicit conversion from QFuture<T> to QFuture<void> | tqtc/lts-6.8 | qt/tqtc-qtbase | Status: NEW | +2 | 0 |
673313,2 | QFuture: allow implicit conversion from QFuture<T> to QFuture<void> | dev | qt/qtbase | Status: MERGED | +2 | 0 |
677434,2 | QFuture: allow implicit conversion from QFuture<T> to QFuture<void> | 6.10 | qt/qtbase | Status: MERGED | +2 | 0 |