1

In the following code example, does the destructor of the shared pointer delete the object that's been destructed defined by new?

auto object = std::shared_ptr<Foo>(new Foo());

I found this in some legacy code and I'm wondering if this causes memleaks or not.

Lightness Races in Orbit
  • 369,052
  • 73
  • 620
  • 1,021
marijnr
  • 121
  • 3

0 Answers0