title: Can I prevent invoking destructor before overloaded delete?
body: <p>I'd like to use boost.pool. It's okay if you don't know about it. Basically, it has two main functions, malloc() and free().</p>
  
  <p>I've overloaded new and delete for my custom defined class test.</p>
  
  <pre><code>class test
  {
  public:
  
      test()
      {
          cout    &lt;&lt; "ctor" &lt;&lt; endl;
      }
  
      ~test()
      {
          cout    &lt;&lt; "dtor" &lt;&lt; endl;
      }
  
      void*   operator new(size_t) throw()
      {
          cout    &lt;&lt; "custom operator new" &lt;&lt; endl;
          return _pool.malloc();
      }
  
      void    operator delete(void* p)
      {
          cout    &lt;&lt; "custom operator delete" &lt;&lt; endl;
          _pool.free(p);
      }
  
      void    show()
      {
          cout    &lt;&lt; _i &lt;&lt; endl;
      }
  
  private:
      int _i;
      static boost::pool&lt;&gt;    _pool;
  };// class test
  
  boost::pool&lt;&gt;   test::_pool(sizeof(test));
  </code></pre>
  
  <p>When I create instance of test using new, constructor was not called but if I delete it, destructor <strong>was</strong> called. Why? and can I avoid it?</p>