Created
June 15, 2021 15:20
-
-
Save BogdanAriton/f3afe5baed62892cde9d8dc6d81b5488 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void clear() noexcept | |
{ | |
if (!isEmpty()) | |
{ | |
Node *current = head.get(); | |
while (current != nullptr) | |
{ | |
Node *temp = current; | |
temp = nullptr; | |
current = current->next.get(); | |
} | |
head = nullptr; | |
size = 0; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment