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 explicitly defined CTxMemPoolEntry copy ctor #11163

Closed

Conversation

danra
Copy link
Contributor

@danra danra commented Aug 26, 2017

CTxMemPoolEntry has an explicitly defined copy ctor which has the same functionality as the implicit default copy ctor which would have been generated otherwise.

Besides being redundant, it violates the rule of three (see https://en.wikipedia.org/wiki/Rule_of_three_(C%2B%2B_programming) ).
The rule of three doesn't -really- cause a resource management issue here, but the reason for that is exactly that there is no need for an explicit copy ctor in the first place since no resources are being managed.

CTxMemPoolEntry has an explicitly defined copy ctor which has the same functionality as the implicit default copy ctor which would have been generated otherwise.

Besides being redundant, it violates the rule of three (see https://en.wikipedia.org/wiki/Rule_of_three_(C%2B%2B_programming) ).
The rule of three doesn't -really- cause a resource management issue here, but the reason for that is exactly that there is no need for an explicit copy ctor in the first place since no resources are being managed.
@promag
Copy link
Member

promag commented Aug 26, 2017

This is the same as #11161, maybe add this commit there and make the PR generic like Remove redundant explicitly defined copy constructor?

@danra
Copy link
Contributor Author

danra commented Aug 26, 2017

Will merge into #11161.

@danra danra closed this Aug 26, 2017
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants