Call a destructor from the constructor?

Back to topics list To post a new topic, please log in or register
avatar
83
BeLikeWater 2015.02.12 13:38
 

Is that possible? Im talking about the same object.

Greetings.

avatar
13006
WHRoeder 2015.02.12 14:45 #
 
You never call a destructor. If you really need it, have the destructor call a function, and the constructor can also.
avatar
21
hji 2015.02.14 07:16 #
 
Yes,why not?
avatar
1110
Ovo 2015.02.14 09:38 #
 
hji:
Yes,why not?
Could you write down a line, with which you call the destructor, please?
avatar
13006
WHRoeder 2015.02.14 15:36 #
 
hji: Yes,why not?
The destructor is called when an object goes out of scope.
{
   object O; // Object is alive
   ~O;       // Kill the object?
   O is still visible here. Is it alive, is it dead, - it's a zombie!
}

avatar
83
BeLikeWater 2015.02.17 17:35 #
 
Thank you!
Back to topics list  

To add comments, please log in or register