Closed GoogleCodeExporter closed 9 years ago
as Alexander Melnikov points out on the list, this will likely not get fixed as
the Google style guide specifies this way.
see
http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml?showone=Reference
_Arguments#Reference_Arguments
tl;dr: google style guide uses pointers for out arguments and references for in
arguments
Original comment by jtolds
on 3 Jan 2013 at 9:21
I can see your point (reserve pointers for objects that may be NULL). However
as others have pointed out, this is following the Google C++ coding style where
we use the distinction between pointers and const-references to distinguish
between output and input parameters.
Sorry, we won't be changing the style we are following in this code.
Original comment by san...@google.com
on 3 Jan 2013 at 4:47
In that case, perhaps the code should at least check that the pointer != NULL
Original comment by jvb...@gmail.com
on 3 Jan 2013 at 5:06
I always hated that rule in the style guide.
There is a pretty straightforward solution here: use a typedefs. Something
descriptive like DB::out_value. Then there can always be a flag to tweak the
typedefs to one's coding style, and it is more descriptive than the stupid pry
vs. ref convention.
Original comment by cbsm...@gmail.com
on 3 Jan 2013 at 6:16
Original issue reported on code.google.com by
jvb...@gmail.com
on 3 Jan 2013 at 6:36