shared_ptr<string> ps1 (new string("ps1")); shared_ptr<string> ps2 (new string("ps2")); //method1: use assignment ps1= ps2; ___________________________
// 1) previous use_count decrements 1(If equal 0, will delete) ___________________________
// 2) ps1 points to current use_count ___________________________
// 3) and current use_count increments 1 //method2: use move ps1 = std::move(ps2); ___________________________
// 1) previous use_count decrements 1(If equal 0, will delete) ___________________________
// 2) ps1 points to current use_count ___________________________
// 3) ps2 will not point to use_count, ps1 point it, but NOT increment 1 //method3: reset ps1.reset(cp); //ok //pointer inside previous ps1 will be deleted.