(C++) std::tr1::shared\_ptr

February 24, 2017 · View on GitHub

 

 

 

 

 

(C++) C++98STL std::tr1::shared_ptr

 

 

std::tr1::shared_ptr is a type of smart pointer that can be copied safely and cheap, without copying the object pointed to. When the last std::tr1::shared_ptr using an object goes out of scope, it will delete the object pointedto.

 

 

 

 

 

 

C++98STL Creating a std::tr1::shared_ptr

 


#include <tr1/memory> int main() {   std::tr1::shared_ptr<int> p; }