[webkit-dev] Change to style guideline: should use type& instead of type* for out arguments

James Robinson jamesr at google.com
Tue Oct 4 14:14:27 PDT 2011


On Tue, Oct 4, 2011 at 2:06 PM, Ryosuke Niwa <rniwa at webkit.org> wrote:

> Hi,
>
> It came to my attention that some people are using raw pointers to pass
> out-arguments (e.g. bug 69366). In my understanding, we use pass by
> reference for out arguments when they have to be modified in callees.
>
> If there's no objection, I'm going to file a bug & upload a patch to state
> this explicitly in the style guideline.
>

Could you explain why?  Is it to document the nullity of the out-param?

I personally find pointers for out parameters to be appropriate in many
situations.  It makes the side effects of manipulating the parameter more
obvious, and it provides a clear way for the caller to indicate that they
don't care about a certain out parameter.  It sounds like you have reasons
to prefer the opposite behavior.

- James


>
> Best,
> Ryosuke Niwa
> Software Engineer
> Google Inc.
>
>
> _______________________________________________
> webkit-dev mailing list
> webkit-dev at lists.webkit.org
> http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20111004/15b5d513/attachment.html>


More information about the webkit-dev mailing list