Closed yexinhua1998 closed 5 months ago
i don't have the references off the top of my head, but iirc, this is to move away from raw pointers and to things like std::optional (new in C++17) to mitigate common errors like dereferencing NULL pointers.
considering how long the pointer guidance has been around, the style guide is taking a bit of a transitional approach. you can see how it talked about absl::optional
at the time, but has since been updated to only mention std::optional
.
Google c++ style sugguest output parameter as pointer before. But after this commit, this suggestion is changed and output parameters is suggested as reference. I am confused about why do this chagne and what problem you meet in practice and what benefit with new rule. Thanks for answer!