I assume that std :: move () has a bit more performance cost in the context of something like:
std::thread thrd(&func, this);
someArrOfThreads[0] = std::move(thrd);
against
std::thread *thrd = new std::thread(&func, this);
someArrOfThreadPointers[0] = thrd;
It's true? And if so, does this question std::move()change the boundaries of the thread's memory or something else?
I understand that there is a difference in the fact that in the first I actually assign the value of the array to the stream, and the other - a pointer to the stream, the stream remains at its address (s) in the second.
source
share