I have the following function:
void MyClass::myFunc(cv::OutputArray dst) const {
cv::Mat result;
...
dst.assign(result);
}
If I run it like this:
cv::Mat result;
myFunc(result);
otherFunc(result);
It works fine and otherFunc recieves result modified by myFunc.
But if I use std::async like this:
cv::Mat result;
auto resultFuture = std::async(&MyClass::myFunc, this, result);
resultFuture.wait();
otherFunc(result);
otherFunc receives empty result. What am I doing wrong?