Jan 25, 2011 at 3:11am UTC
Hi,
I saw couple of parameters in destructor's. Of course one was 'this' pointer, and other is '__in_chrg'. Can any one please let me know why this is used (heard because of virtual bases but not sure) and what does the value passed for it tell?
By,
Vasu
Last edited on Jan 25, 2011 at 5:00am UTC
Jan 27, 2011 at 4:48am UTC
this
is the current thing you are working on...
1 2 3 4 5 6 7 8 9
class something {
int p;
something(const int &set) : p(set);
void donothing() { std::cout << this ->p; }
};
something s(123);
s.donothing();
when
donothing()
is called with
s
the
this
is the variable
s
...
__in_chrg is probably defined where it is used... what are you looking at that has it?
Last edited on Jan 27, 2011 at 4:48am UTC
Jan 27, 2011 at 2:17pm UTC
If you could post whatever you found with that it would help.
OTOH, I believe this might have to do with whether or not the destructor must free the memory allocated to the object after it finishes.