Update List.hpp

main
p68710245 1 year ago
parent e7c443d5a6
commit 70c9fb5205

@ -41,7 +41,7 @@ template <typename T>
void List<T>::clear()
{
while (head->link)
head->remove_after();
delete head->remove_after();
tail = head; // 务必注意本类当中的操作是否会影响tail
}
@ -73,7 +73,8 @@ void List<T>::print() const
Node<T> *tempP{head->link};
while (tempP)
{
tempP->print();
//tempP->print();
std::cout << tempP->get_info() << '\t';
tempP = tempP->link;
}
std::cout << '\n';

Loading…
Cancel
Save