我设置了一个结构体 struct Node{...}Nodes;
想用CList的AddTail添加一结构体指针,即list.AddTail(&Nodes),以便Nodes改变时list的内容可以同步(因为是指针嘛)
但是CList<Node,Node&>只能做值传递,CList<&Node,Node&>又编译不过。
我对模板不熟,请各位指点。
想用CList的AddTail添加一结构体指针,即list.AddTail(&Nodes),以便Nodes改变时list的内容可以同步(因为是指针嘛)
但是CList<Node,Node&>只能做值传递,CList<&Node,Node&>又编译不过。
我对模板不熟,请各位指点。
例如:
CTypedPtrList<CPtrList, struct Node*> myList;
为Node实现copy constructor和assignment operator当然也可以用Node*做为节点类型。
DentistryDoctor的方法看不懂,copy constructor和assignment operator是类的重载吗?我的Node是结构体能做到吗?有空的话PM我,希望能得到你的指点