64,637
社区成员
发帖
与我相关
我的任务
分享
#include <list>
class CNodeList: public std::list<CNodeList>
{
public:
CNodeList(){};
int i;
};
CNodeList a;
CNodeList b;
a.push_back(b);
class CNodeList
{
public:
CNodeList(){};
int i;
private:
std::list<int> list_;
};
或者更简单一点
struct CNode
{
int a;
//other data
};
int main()
{
std::list<CNode> nodeList;
CNode nodeA, nodeB;
nodeList.emplace_back(nodeA);
nodeList.emplace_back(nodeB);
return 0;
}
c++ is not c