You can use a destructor explicitly to destroy objects, although this practice is not recommended.
I have an enemy object that is destroyed upon being intersected with a projectile object. Instead of making a bunch of if statements in a for loop outside the object, wouldn't it be easier and cleaner to make the enemy object just destroy itself if it detects colliding with a projectile? Would it be okay, according to conventions, to call ~enemy INSIDE the enemy class, rather than having to code outside the enemy class?
Edited by StoneMask, 18 October 2012 - 10:40 AM.