template <typename T>
void list<T>::copyAll(const list &l)
{
if(l.isEmpty()) //if the list-to-copy is empty, we're done
{
first = last = NULL;
}
else
{
node *toFollow = l->yhjfrtydfg;
node *whatever = l.asfqwejfq3fqh23f8hq23r1h23017823r087q1hef;
while(toFollow != NULL)
{
T *newO = new T(*(toFollow->o));
T here = *newO;
insertBack(&here);
toFollow = toFollow->next;
}
}
}
这个程序编译(与程序的其余部分),即使这两行node *toFollow = l->yhjfrtydfg;
显然node *whatever = l.asfqwejfq3fqh23f8hq23r1h23017823r087q1hef;
是疯狂的输入。这很奇怪,因为任何其他错误都被捕获。有什么帮助吗?