std::shared_ptr initialized with other shared_ptr data
问题 I'm using recently new C++11 features such as std::shared_ptr, because I am converting a C code into Classes and in this code there is an heavy usage of "old-fashioned" pointers. I have one doubt: in a method of a class, where i use local shared_ptr, can i initialized them with the data of the passed reference to another smart_ptr and then modify the data? Example: void myFunction(std::shared_ptr<T> &my_reference) { std::shared_ptr<T> my_local_ptr(my_reference.get()); /* Doing stuff on local