c++ threads
Thread is created with std::thread
std::thread instance cannot be copied, but can be moved
A thread object manages a kernel thread, so it is a resource management class. So like most classes which manage resources, it cannot be copied, but it can be moved.
It is the same as with files. If you have a class which manages a file handle, then you cannot copy that class because it would be chaos if two different classes think they both own the same file handle.
The constructor for the thread takes a callable object as its first argument, so that could be a function pointer.
It could be a lambda expression. It could be a functor with an overloaded operator. It could be a member function pointer. It could be an object created by bind() and so on.
And this is the entry point to the thread.
Rules of Thread Function:
The function, the callable object that we pass to the thread must not be overloaded.
We can give it arguments and it can take these by value, by reference or by move.
If it returns a value, then that [value] is going to be ignored.