title: c++ destructor calls a delete operator?
body: <p>Why does my MSVC12 compiler not like this?</p>
  
  <pre><code>#include &lt;new&gt;
  
  class thing
  {
  public:
      thing() {}
      ~thing() {}
      static void operator delete(void* ptr) = delete;
  };
  
  int main()
  {
      int g;
      void* p = &amp;g;
      thing* t1 = new(p) thing();
      t1-&gt;~thing();
  
      return 0;
  }
  </code></pre>
  
  <p>The error I get is oddly on the closing brace of main():</p>
  
  <p>Error   2   error C2280: 'void thing::operator delete(void *)' : attempting to reference a deleted function</p>
  
  <p>If I comment out the explicit destructor call, the error goes away, implying that the explicit destructor call is trying to call operator delete(void*). This does not make intuitive sense. As you can probably see from the code here, I've already managed my own memory, and I don't want anyone to call delete on thing ever.</p>