3 ms·
I think another way to put it is that when I am calling a non-async function, for instance, I am not sharing ownership of the shared object. So calling a norma
by beached_whale 7y ago
I think another way to put it is that when I am calling a non-async function, for instance, I am not sharing ownership of the shared object. So calling a normal function that blocks probably would be best as the Widget ref/Widget * with/without const depending on the type of operation. But the copy of a shared_ptr<T> is saying that we are sharing ownership and the cases where that applies. An async operation, like the argument to a thread or a task, probably would require sharing ownership/lifetime of the object. Or it may be a transfer of ownership via std::move.