心渐渐失空

导航

2020年1月13日 #

证明:C++ std::shared_ptr的引用不会增加它的计数值

摘要: #include <thread> #include <memory> #include <Windows.h> int main() { std::thread t; { std::shared_ptr<int> p(new int(1), [](int* p) { printf("delete\ 阅读全文

posted @ 2020-01-13 09:57 心渐渐失空 阅读(1048) 评论(0) 推荐(0)