This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: destructor of referenced object doesn't work


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]