Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove redundant null check before delete in wrapper_class #19

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

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