| 2 | #include <memory> |
| 3 | |
| 4 | int main(){ |
| 5 | auto sharedPtr=std::make_shared<int>(2011); |
| 6 | std::weak_ptr<int> weakPtr(sharedPtr); |
| 7 | |
| 8 | if( std::shared_ptr<int> sharedPtr1 = weakPtr.lock() ) { |
| 9 | std::cout << "*sharedPtr: " << *sharedPtr << std::endl; |
| 10 | } |
| 11 | else{ |
| 12 | } |
| 13 | |
| 14 | } |
| 15 |
nothing calls this directly
no outgoing calls
no test coverage detected