4
Jak zadeklarować std :: unique_ptr i do czego służy?
Próbuję zrozumieć, jak std::unique_ptrdziała i do tego znalazłem ten dokument. Autor zaczyna od następującego przykładu: #include <utility> //declarations of unique_ptr using std::unique_ptr; // default construction unique_ptr<int> up; //creates an empty object // initialize with an argument unique_ptr<int> uptr (new int(3)); double *pd= new double; unique_ptr<double> uptr2 (pd); // overloaded * …
95
c++
pointers
std
unique-ptr