MCPcopy Create free account
hub / github.com/andreasfertig/cppinsights / main

Function main

tests/IfSwitchInitHandler5Test.cpp:4–14  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2#include <memory>
3
4int 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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected