Re: typedefs and structs

From: thockin
Date: Wed Nov 09 2005 - 15:29:22 EST


On Wed, Nov 09, 2005 at 01:38:28PM -0600, linas wrote:
> On Wed, Nov 09, 2005 at 11:36:25AM -0800, thockin@xxxxxxxxxx was heard to remark:
> > Umm, references are implemented as pointers. Instead of a "zoo of
> > pointers" you have a "zoo of references". No functional difference.
>
> Sigh.
>
> I think you are confusing references and pointers. By definition
> you cannot "store a reference"; however, you can "dereference"
> an object and store a pointer to it.


Sigh, That's funny - I've written C++ code which has references as members
of objects. You absolutely *can* store a reference.

References are simply a syntactic simplification to eliminate the
different pointer-dereference notation. If they make you think about a
problem differently, that's fine, but they are really just pointers in
disguise.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/