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

Do not define empty non-virtual destructors #18

Merged

Conversation

danielkrupinski
Copy link
Contributor

Providing an empty definition of a non-virtual destructor is pointless, as the compiler can implicitly provide the definition itself. Moreover, it makes a type non-trivially destructible what prevents the compiler from applying certain optimizations (this isn't the case in this PR).

@adam-sawicki-a
Copy link
Collaborator

Thank you for this contribution. You are right. I only don't like that you remove the comments from the destructors. They are meaningful. I think they should be preserved, possibly moved to class definition next to e.g. commented destructor like:

// Comment
//~List() { }

@adam-sawicki-a adam-sawicki-a merged commit f50f65d into GPUOpen-LibrariesAndSDKs:master Sep 16, 2021
@adam-sawicki-a
Copy link
Collaborator

Thank you for this contribution!

@danielkrupinski
Copy link
Contributor Author

More are incoming :)

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.

None yet

2 participants