Sequence of constructor calls and destructor calls.
From: Honne Gowda A (honne_at_lucent.com)
Date: 10/31/03
- Previous message: Rolf Hemmerling: "Howto access .RC/.RES Ressource files with portable C++ code ( BCC,MSVC,GNU-C++,OpenWatcom) ?"
- Next in thread: Josephine Schafer: "Re: Sequence of constructor calls and destructor calls."
- Reply: Josephine Schafer: "Re: Sequence of constructor calls and destructor calls."
- Reply: Karl Heinz Buchegger: "Re: Sequence of constructor calls and destructor calls."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 31 Oct 2003 13:42:54 +0530
Hi,
Can anybody clarify why destruction happens in reverse way?
for example A<-B<-C, when C's object is constructed, ctor calls will A(),B() and
C(), when this object is destroyed, sequence of calls will be ~C(),~B(),and
~C(). I am wondering why cant' we destroy the object like ctor way?..Are there
any good reasons for this?
thanks,
-Honne
--
- Previous message: Rolf Hemmerling: "Howto access .RC/.RES Ressource files with portable C++ code ( BCC,MSVC,GNU-C++,OpenWatcom) ?"
- Next in thread: Josephine Schafer: "Re: Sequence of constructor calls and destructor calls."
- Reply: Josephine Schafer: "Re: Sequence of constructor calls and destructor calls."
- Reply: Karl Heinz Buchegger: "Re: Sequence of constructor calls and destructor calls."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]