std::unique_ptr<std::string> foo_ptr(new std::string("foo"));
foo_ptr.reset(foo_ptr.get());
std::cout << *foo_ptr << std::endl; //prints "foo" so obj hasn't been deleted
//runtime error: "pointer being freed was not allocated"
为什么会出现运行时错误,“foo”被打印出来只是巧合吗?