我注意到你也可以通过以下方式横切列表
for (POSITION curPos = batchRescheduleReasons.GetHeadPosition(); curPos != NULL;)
{
m_pRescheduleReasons.push_back(new CSchRescheduleReasons(batchRescheduleReasons.GetNext(curPos)));
}
但GetHeadPostion()只返回列表的头部,那么它是如何迭代的?是在GetHeadPostion()中增加的头部?
我们不应该做以下事情吗?
POSITION pos = MyIntList.GetHeadPosition();
while (pos)
{
int Number = MyIntList.GetNext(pos);
// do something with the number
}