On Tue, Jul 28, 2009 at 4:29 PM, Jozwiak, John <jjozw...@qualcomm.com>wrote:

> Isn't the C++ "reference" annotation
>
>  char & x;
>
> tantamount to declaration of a pointer
>
>  char * x;
>
> to whom NULL assignment, as detectable at compile time, is a compile-time
> error?


Remember that you can't "reassign" a reference like you can a pointer
(though you can naively write code to do it, and it will compile, but it
won't do what you want).  This rules out the use of references in some
situations.

References are also more "subtle" in that you can write code that changes
things when it's not so obvious what's changing as when you use pointers.
 This is the primary reason that for example the Google style guide bans the
use of non-const references.

PK
_______________________________________________
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev

Reply via email to