View Single Post
  #9  
Old 08-24-2014, 18:58
mr.exodia mr.exodia is offline
Retired Moderator
 
Join Date: Nov 2011
Posts: 784
Rept. Given: 492
Rept. Rcvd 1,122 Times in 305 Posts
Thanks Given: 90
Thanks Rcvd at 711 Times in 333 Posts
mr.exodia Reputation: 1100-1299 mr.exodia Reputation: 1100-1299 mr.exodia Reputation: 1100-1299 mr.exodia Reputation: 1100-1299 mr.exodia Reputation: 1100-1299 mr.exodia Reputation: 1100-1299 mr.exodia Reputation: 1100-1299 mr.exodia Reputation: 1100-1299 mr.exodia Reputation: 1100-1299
@BlackWhite: here is an example of how you should work. When you want to call the deconstructor, let the variable go out of scope or delete it.

Code:
http://codepad.org/1jq6nsQF

Output:
Code:
test() called!
 >Animal("Schnickelfritz") called! 
 >Cat("Schnickelfritz") called! 
 >~Cat("Schnickelfritz") called! 
 >~Animal("Schnickelfritz") called! 
test() returned!

deltest() called!
 >Animal("Koobenfarben") called! 
 >Cat("Koobenfarben") called! 
 >~Cat("Koobenfarben") called! 
 >~Animal("Koobenfarben") called! 
deltest() returned!
Reply With Quote