我是C++的新手。我所遇到的std ::的unique_ptr和std :: shared_ptr的的使用在我的代碼C++中std :: unique_ptr和std :: shared_ptr的區別
typedef std::unique_ptr<type1> type1Handler;
typedef std::shared_ptr<type2> type2Handler;
我有兩個問題:
- 什麼是使用
unique_ptr
和shared_ptr
- 的優勢是什麼他們之間的主要區別是什麼?
可能是一個例子會很有幫助!
你嘗試谷歌呢? –