Re: reference type methods
On Jul 17, 5:10 am, Eugene Vernikovskiy
<eugene.vernikovs...@verizon.net> wrote:
I think you can simplify things with references a lot if you
realize that there is no significant difference between
references and pointers.
Oh yes there are. To begin with, references aren't objects, and
pointers are. What you probably meant to say is that references
behave very much like automatically dereferenced pointers.
For example
int iX = 10;
int& rX = iX;
int* pX = &iX;
In both cases we save an address of the variable iX in a
reference or in a pointer.
That's one possible implementation. But the semantics of
references have been carefully specified so that they could be
implemented as pointers. (In such direct cases, they usually
aren't. But they could be.)
--
James Kanze (GABI Software) email:james.kanze@gmail.com
Conseils en informatique orient=E9e objet/
Beratung in objektorientierter Datenverarbeitung
9 place S=E9mard, 78210 St.-Cyr-l'=C9cole, France, +33 (0)1 30 23 00 34