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