Create shared_ptr to stack object
问题 In my method a Player object is created like: Player player(fullName,age); My teacher gave us a piece of code with a constructor that takes a shared_ptr to a player object. //constructor of the class SomeClass(const std::shared_ptr<Socket> client, std::shared_ptr<Player> player) Lets say we want to call the constructor of SomeClass and pass the player object we created on stack. Is it ever safe/possible/good to create a shared_ptr from a stack object? To make the question more understandable