我有一个虚拟班子<代码>basic_action。 <代码>sippeers 继承类别basic_action
。 储存<代码>sippeers 班级 使用<代码>boost:ptr_list/code>。 这里的例子有:
boost::ptr_list<basic_action> ActionsList;
sippeers spclass;
ActionsList.push_back(&spclass);
basic_action *sp = ActionsList.front();
Here I create an instance of prt_list
with pointers to instances of my basic_action
classes.
Next I make new instance of my sippeers
class.
Next I insert pointer to sippeers
class into ptr_list
.
最后一点是失败的。
Cannot convert from basic_action to basic_action * .
但是,在座的有<编码>basic_action *内,而不是basic_action
!