-
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