Download MetaTrader 5

Call a destructor from the constructor?

To add comments, please log in or register
Luis
226
Luis  

Is that possible? Im talking about the same object.

Greetings.

whroeder1
15085
whroeder1  
You never call a destructor. If you really need it, have the destructor call a function, and the constructor can also.
hji
26
hji  
Yes,why not?
Ex Ovo Omnia
3230
Ex Ovo Omnia  
hji:
Yes,why not?
Could you write down a line, with which you call the destructor, please?
whroeder1
15085
whroeder1  
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!
}
Luis
226
Luis  
Thank you!
To add comments, please log in or register