From 043e1c5745759add3c2e21cf02d13ccfc818857c Mon Sep 17 00:00:00 2001 From: Jidong Xiao Date: Tue, 10 Oct 2023 13:43:46 -0400 Subject: [PATCH] question about the list erase function --- lectures/11_list_implementation/list.h | 1 + 1 file changed, 1 insertion(+) diff --git a/lectures/11_list_implementation/list.h b/lectures/11_list_implementation/list.h index ee44eb8..3e120b0 100644 --- a/lectures/11_list_implementation/list.h +++ b/lectures/11_list_implementation/list.h @@ -146,6 +146,7 @@ class dslist { void erase(iterator itr){ dslist::iterator itr2 = itr; itr2++; + // Question: is this right? while (itr2 != this->end()) { *itr = *itr2; itr++;