4
Cách khai báo std :: unique_ptr và công dụng của nó là gì?
Tôi cố gắng hiểu cách thức std::unique_ptrhoạt động và tôi đã tìm thấy tài liệu này . Tác giả bắt đầu từ ví dụ sau: #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)); …
95
c++
pointers
std
unique-ptr