Open3D中大量使用的智能指针为shared_ptr。shared_ptr的作用有如同指针,但会记录有多少个shared_ptrs共同指向一个对象。这便是所谓的引用计数(reference counting)。一旦最后一个这样的指针被销毁,也就是一旦某个对象的引用计数变为0,这个对象会被自动删除。
shared_ptr
shared_ptrs
#include <iostream> #include <Open3D/Open3D.h> using namespace std; int