If I have a function that defines a local variable of automatic storage called newPlayer and I pass it to an asynchronous function that executes a callback called handleConnection which takes newPlayer by reference, is handleConnection's reference to newPlayer valid?
My concern is that by the time handleConnection executes, the reference to newPlayer would be destroyed and thus suppliedPlayer points to invalid memory, but preliminary testing (reading and writing to the object in the two different functions) seem to indicate that it's still a valid object...
... But obviously I don't want to build an application on an incorrect assumption...
As you've correctly guessed, there's no guarantee that the Player instance won't have been destructed by the time Server::handleConnection() is called.