This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: destructor of referenced object doesn't work
- To: Takashi Sasaki <takasi-s at is dot aist-nara dot ac dot jp>
- Subject: Re: destructor of referenced object doesn't work
- From: Horst von Brand <vonbrand at sleipnir dot valparaiso dot cl>
- Date: Tue, 25 Jan 2000 20:48:34 -0300
- Cc: gcc-bugs at gcc dot gnu dot org
Takashi Sasaki <takasi-s@is.aist-nara.ac.jp> said:
> In the following code, destructor of TestClass doesn't called.
> When the reference 'r' is out of scope, the destructor must
> be called.
A reference is just a funny pointer, the real object lives in the heap. I
think you are wrong here.
--
Horst von Brand vonbrand@sleipnir.valparaiso.cl
Casilla 9G, Viņa del Mar, Chile +56 32 672616