在C++中的struct中的struct

SPS*_*SPS 4 c++ struct visual-studio-2010

我需要帮助才能很好地理解它的用法 struct

我有这段代码:

struct PCD
{
    PointCloud::Ptr cloud;
    std::string f_name;
    PCD() : cloud (new PointCloud) {};
};
Run Code Online (Sandbox Code Playgroud)

但我不明白这行怎么可能:

PCD() : cloud (new PointCloud) {};
Run Code Online (Sandbox Code Playgroud)

或者更好,它做什么?一个structstruct

我在哪里可以找到一个很好的解释?

Aes*_*ete 5

cloud是指向PointCloud对象的指针.它是PCD结构的成员.使用初始化列表初始化此结构时,将为该指针分配一个新PointCloud对象.

这很可能在PointCloudstruct/class中找到:

typedef PointCloud* Ptr;
Run Code Online (Sandbox Code Playgroud)