线程安全特性:
shared_ptr和weak_ptr中使用的引用技术是原子变量int,所以这两只能指针都是线程安全的。
#include <memory>
#include <iostream>
using namespace std;
class Test{
public:
Test(int b=10):a(b){
cout<<"construct"<<endl; }
~Test(){
cout<<"destruct"<<endl; }
void show()const{
cout<<"a = "<<a<<endl