std::shared_ptr 和普通指针的转换 普通指针和std::shared_ptr相互转化见示例 struct test { int num; string name; }; test* pTest = new test(); std::shared_ptr<test> ptr_test = std::shared_ptr<test>(pTest); //普通指针转shared_ptr std::shared_ptr<test> ptr_test2 = std::make_share...
相互转化见示例 1structtest2{3intnum;4stringname;5};67test* pTest =newtest();8std::shared_ptr<test> ptr_test = std::shared_ptr<test>(pTest);//普通指针转shared_ptr910std::shared_ptr<test> ptr_test2 = std::make_shared<test>();11test* pTest2 = ptr_test2.get();//shared_ptr转...