title: Detecting whether a destructor has been called
body: <p>Im making a board game where the game ends when one piece is destroyed e.g a king dying in chess. </p>
  
  <p>Now I have the possibility of searching through all my objects and seeing that e.g there WERE two pointers to king objects and now there's only one hence game is over and the team with the remaining king won. </p>
  
  <p>I was however wondering if it would instead be possible to say something along the lines of:</p>
  
  <pre><code>if(king_destructor is called){
       game over;}
  </code></pre>
  
  <p>But after searching a bit I havent found a way to do that. </p>
  
  <p>More specifically my class structure is: </p>
  
  <pre><code>class pieces{}
  class king : public pieces{}
  </code></pre>
  
  <p>where pieces is an abstract class and there are derived classes for each individual piece. In the derived class for the 'king' piece there is its destructor.
  Otherwise: </p>
  
  <pre><code>class game_board{}
  </code></pre>
  
  <p>which is another abstract class which has data members which are pointers to pieces objects. To be exact, I have a map variable which take the position of the piece on the board as the key and a pointer to a piece object as the value.</p>
  
  <p>Finally I have a derived class :</p>
  
  <pre><code>class game_rules: public game_board{}
  </code></pre>
  
  <p>it is within this class that I have a function which detects when the game is over. </p>
  
  <p>I experimented with using a static variable that is modified by the 'king' destructor but this is out of the scope of my game_rules class. </p>
  
  <p>Does anyone know whether this is possible? </p>