title: Why only static member can access private destructor?
body: <pre><code>#include &lt;iostream&gt;
  using namespace std;
  
  class MonsterDB
  {
  private:
      ~MonsterDB() {}; //private destructor
  public:
      static void DestroyInstance(MonsterDB* pInstance)
      {
          //static member can access private destructor
          delete pInstance;
      }
      //...other methods
  };
  int main()
  {
      // instantiation in heap
      MonsterDB* pMyDatabase = new MonsterDB();
  
      MonsterDB::DestroyInstance(pMyDatabase);
      
      return 0;
  }
  </code></pre>
  <p>guys , why only static member can access private destructor?</p>
  <p>When i remove static from this :</p>
  <pre><code>static void DestroyInstance(MonsterDB* pInstance)
  </code></pre>
  <p>i get an error!</p>
  <p>The reason i asked the question is that :</p>
  <pre><code>#include &lt;iostream&gt;
  using namespace std;
  
  class MonsterDB
  {
  private:
      int variable;
  
      
      
  public:
      void printer()
      {
          cout&lt;&lt;variable&lt;&lt;endl;
      }
      void instancer(int s)
      {
          variable = s;
      }
      
      //...other methods
  };
  
  int main()
  {
      MonsterDB obj1;
      int var = 5;
      obj1.instancer(var);
      obj1.printer();
  }
  </code></pre>
  <p>In the above code I made, both functions : printer and instancer accessed private variable without having to specify static keyword in those functions.</p>
  <p>Sorry for your time, advance thanks! hoping to give real intuition behind this.</p>