When would I want to construct a shared pointer from a raw pointer
问题 Thanks to std::make_shared , I wonder, whether the constructor for std::shared_ptr , which takes a raw pointer has any value except when interfacing with legacy / library code, e.g. when storing the output of a factory. Are there other legitimate use-cases? Is it reasonable advice to avoid that constructor? Even to the extend of putting code checks for it in place that warn the programmer whenever it is used? Should the same guidelines (whatever they are) apply to shared_ptr<T>::reset(T*) ?