Skip to content

Instantly share code, notes, and snippets.

@BogdanAriton
Created June 15, 2021 15:20
Show Gist options
  • Save BogdanAriton/f3afe5baed62892cde9d8dc6d81b5488 to your computer and use it in GitHub Desktop.
Save BogdanAriton/f3afe5baed62892cde9d8dc6d81b5488 to your computer and use it in GitHub Desktop.
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