Suppose I have:
void f()
{
SomeClass someObject;
pplx::create_task([&]()-> SomeClass { return someObject; });
}
void g()
{
//Allocate automatic objects
}
int main()
{
f();
g();
}
Is this guaranteed to work? my logic says no since by the time the task runs someObject
might be out of scope.