diff options
suggest changes
In the remove_after function, I added a check if (!it.currentElementPtr->next) because if we have a list with two elements and move an iterator to the end of the list, it will try to access to_delete->next, which would result in an error. This check also handles the case when the size is equal to 1. In the insert_after function, if we insert after the tail and then try to push_back another element, we might lose data. Therefore, if itNode == _tail, we should update _tail to point to the new node.
0 files changed, 0 insertions, 0 deletions
