Can I assign another QFuture object to already running QFuture object? Like in the example below:
QFuture<int> future = QtConcurrent::run(function);
future = QtConcurrent::run(anotherFunciton); //assume that future is still running at this point
I realize that this particular example doesn't make much sense, it's just for the sake of example. Is it safe to make such an assigment, assuming that the result of the first function doesn't interest me anymore? Or do I have to cancel it first? And if so, do I have to wait for cancelation to complete?
QFuture<int> future = QtConcurrent::run(function);
future.cancel();
future.waitForFinished(); //is waiting necessary?
future = QtConcurrent::run(anotherFunciton);