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

Audit for proper "rule of 7" adherence in custom classes #110

Open
shinymerlyn opened this issue Aug 30, 2023 · 0 comments
Open

Audit for proper "rule of 7" adherence in custom classes #110

shinymerlyn opened this issue Aug 30, 2023 · 0 comments

Comments

@shinymerlyn
Copy link
Contributor

shinymerlyn commented Aug 30, 2023

Fayti1703 in Discord pointed out at least one example of a class that has this implemented wrong. In this case, it's writing to uninitialized data, but there are also other issues with this class:

*impl_ = *other.impl_;

We should go through any custom class that has any of the "Big Seven" and either remove them when not needed, add the remaining "Big Seven" they're missing, or migrate all the lifetime management details to a class that only manages lifetime (smart pointers).

I use the count of "7" here in quotes, partly because this is a named idiom/problem in C++, and partly because it's also known as the rule of 3, 5, or 6, depending on which iteration of C++ it's talking about. And I am not 100% which C++ standard this codebase should be conforming to:

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

No branches or pull requests

1 participant