title: Stopping destructor being called
body: <p>I have a class on which I am overloading new and delete (these fetch and return memory from and to a memory pool). What's frustrating me is that the class on which I have overloaded still has it's destructor called before the delete overloaded function get's called. How can I stop this?</p>
  
  <pre><code>class Message
  {
      ~Message() { ... }
  
      void* operator new(std::size_t sz) { ... }
      void operator delete(void* ptr) { ... }
  };
  </code></pre>
  
  <p><strong>EDIT:</strong></p>
  
  <p>Am correct in thinking that the members of the class will be destructed but the memory won't be freed by the destructors; the delete function owns this responsiblity in which case I can stop the memory from being deallocated?</p>
  
  <p><strong>OUTCOME:</strong>
  Penny dropped that the allocation/deallocation of memory and construction/destruction are separate items. I now have empty destructors and overloaded new/delete.</p>