1 #include <memory> 2 #include <string> 3 4 int main()5main() 6 { 7 std::shared_ptr<char> nsp; 8 std::shared_ptr<int> isp(new int{123}); 9 std::shared_ptr<std::string> ssp = std::make_shared<std::string>("foobar"); 10 11 std::weak_ptr<char> nwp; 12 std::weak_ptr<int> iwp = isp; 13 std::weak_ptr<std::string> swp = ssp; 14 15 nsp.reset(); // Set break point at this line. 16 isp.reset(); 17 ssp.reset(); 18 19 return 0; // Set break point at this line. 20 } 21