Home > Net >  Is something::something something() also a way to use scope resolution operator?
Is something::something something() also a way to use scope resolution operator?

Time:10-24

I was trying to understand a C program which used point cloud library and in that code I came across a strange syntax -

pcl::PointCloud<pcl::Normal>::Ptr cloud_normals(new pcl::PointCloud<pcl::Normal>);

I read about scope resolution operator but I am still confused whether or not this ''cloud_normals'' is a function of Ptr library. Can someone help me understand whats happening in this line of code?

CodePudding user response:

pcl::PointCloud<pcl::Normal>::Ptr cloud_normals(new pcl::PointCloud<pcl::Normal>);

Here cloud_normals is a shared pointer to a PointCloud which contains pcl::Normal types. Check here.

This line is creating an object of type PointCloud<pcl::Normal> and assigning it to the share pointer cloud_normals.

  • Related