Skip to content

Conversation

tbobo
Copy link

@tbobo tbobo commented Feb 15, 2024

As it turns out, the C++ standard guarantees that a delete against a null pointer is a no-op. From https://en.cppreference.com/w/cpp/memory/new/operator_delete:

In all cases, if ptr is a null pointer, the standard library deallocation functions do nothing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant