Skip to content

CZString assignment operator - pass by reference #322

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

Closed
wants to merge 1 commit into from

Conversation

ya1gaurav
Copy link
Contributor

Passing by reference.

@ya1gaurav
Copy link
Contributor Author

Done in 321. Closing this.

@ya1gaurav ya1gaurav closed this Jul 30, 2015
@BillyDonahue
Copy link
Contributor

Wait, why was this changed?

CZString& operator=(CZString other);

^^^
This is perfectly valid.
What static analyzer balked at that? This is a basic copy-and-swap idiom.

The "fix" in this PR changes the "other" to be a mutable reference, which is really incorrect.

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.

2 participants