question about the list erase function

This commit is contained in:
Jidong Xiao
2023-10-10 13:43:46 -04:00
parent 0af58ca37a
commit 043e1c5745

View File

@@ -146,6 +146,7 @@ class dslist {
void erase(iterator itr){
dslist<T>::iterator itr2 = itr;
itr2++;
// Question: is this right?
while (itr2 != this->end()) {
*itr = *itr2;
itr++;