Originally posted by mamio
Hi,

- clone is usually implemented as returning a pointer to the cloned object. Is it correct to have it return a reference instead?

A related question is:

- If X is a reference to an object. Is it correct to write

delete &X? I mean, is &X technically a pointer?
Syntactically, it's fine. Semantically, you could be in big trouble:
Code:
int i;
int * j = new int;
int &ri = i;
int &rj = *j;

delete &rj;  // OK (I'm fairly sure...)
delete &ri;  // Oops!