Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/changkun/modern-cpp-tutorial
/ ~B
Method
~B
code/5/5.3.cpp:17–19 ·
view source on GitHub ↗
Source
from the content-addressed store, hash-verified
15
public:
16
std::shared_ptr<A> pointer;
17
~B() {
18
std::cout <<
"B 被销毁"
<< std::endl;
19
}
20
};
21
int main() {
22
std::shared_ptr<A> a = std::make_shared<A>();
Callers
nothing calls this directly
Calls
no outgoing calls
Tested by
no test coverage detected