个人介绍
Use reset to change the stored owned by the unique_ptr to ptr and then delete the original stored pointer. If the unique_ptr wasn't empty, reset invokes the deleter function returned by on the original stored pointer.
Because reset first stores the new pointer ptr, and then deletes the original stored pointer, it's possible for reset to immediately delete ptr if it's the same as the original stored pointer.
工作经历
2022-09-05 -2024-10-16郑州工业项目总监
// stl_release_unique.cpp // Compile by using: cl /W4 /EHsc stl_release_unique.cpp #include #include struct Sample { int content_; Sample(int content) : content_(content) { std::cout
教育经历
2023-10-09 - 2024-10-22河南科技大学软件工程本科