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 an excessive mutable type specifier #2359

Merged
merged 1 commit into from
Aug 6, 2019

Conversation

kuzkry
Copy link
Contributor

@kuzkry kuzkry commented Aug 1, 2019

The private mutable member of MockFunction cannot be reached from outside and all its
non-static member functions are not const. Alternatively, we could add const to every function of MockFunction, though it's a much worse idea I believe.

@adambadura - watch out, this will conflict with your #2350 if this gets merged first.

MockFunction's private member cannot be reached from outside and all its
non-static member functions are not const.
@gennadiycivil
Copy link
Contributor

gennadiycivil commented Aug 5, 2019

Thank your for this contribution. Could you please elaborate and provide more information on exactly the issue / problems this is trying to address.
What is the before/after effect this would create and how is this beneficial?
In other words, is there a concrete non-theoretical case where this can be illustrated?

@kuzkry
Copy link
Contributor Author

kuzkry commented Aug 6, 2019

Hmm, pardon me, actually nothing concrete comes to my mind. This is, I suppose, because of the pure nature of mutable which should be given only to make members of a const object modifiable. We shouldn't use it without a specific, exceptional need.
I've even digged into git history in order to find and ask an author but it turned out to be no-one specific, i.e. Abseil Team in de5be0. If this is possible for you to find them, please do.
Last but not least, I could apply the reversed logic and ask if there is a scenario that requires having this mutable ;) Perhaps, it's the right way to think about it.

@gennadiycivil
Copy link
Contributor

Looking, stay tuned

@gennadiycivil
Copy link
Contributor

261151513

CJ-Johnson added a commit that referenced this pull request Aug 6, 2019
@CJ-Johnson CJ-Johnson merged commit 637b041 into google:master Aug 6, 2019
CJ-Johnson added a commit that referenced this pull request Aug 6, 2019
@kuzkry kuzkry deleted the superfluous-mutable branch August 6, 2019 21:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants