-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Convert CommandLine member references to pointers #4301
Conversation
Discussion seems to be leaning towards more passing by reference, so I've changed that here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving since this matches what was discussed in #style, even though I prefer the all pointer version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just wanted to say -- this also LGTM as is as an incremental step. e can fix forward with whatever subsequent style tweaks come up. Or happy if you'd rather update this PR based on the latest discussions.
7873981
to
2cffb1e
Compare
That's fine, given the prior commit already had pointers I think it's easier to unroll to that here. I've also add "must not be null" comments per your style request. |
[Context](https://discord.com/channels/655572317891461132/821113559755784242/1283516297686286377). Some relevant Google C++ style is at [Inputs and Outputs](https://google.github.io/styleguide/cppguide.html#Inputs_and_Outputs). #4301 is an example application of the style. --------- Co-authored-by: Chandler Carruth <chandlerc@gmail.com>
This follows up on a style question about whether to prefer reference members or pointers. This PR converts to pointers as a demonstration of that style choice.
Note, I'm trying to update constructors to match use of
*
based on whether they keep a reference. I'm removing a fewconst&
uses where no reference was kept (i.e., it was just copied, and didn't seem worth a move).I'm changing
AddArgImpl
to return anArg*
because it just gets passed to a constructor, seems simpler this way.