title: why this error happens when I release memory for map through 'delete' statement?
body: <p>In the program below I try to release memory for a <code>std::map</code> object. </p>
  
  <pre><code>#include &lt;map&gt;
  #include &lt;iostream&gt;
  #include &lt;unistd.h&gt;
  
  int main() {
    // std::map&lt;int, int&gt; *mp = new std::map&lt;int, int&gt;;;
    std::map&lt;int, int&gt; mp;
    for(int i = 0; i &lt; 999999; i++){
      // mp-&gt;insert(std::pair&lt;int, int&gt;(i, 999999-i )); 
      mp[i] = 999999-i;
    }
  
    delete &amp;mp;
    // delete mp;
    pause();
  }
  </code></pre>
  
  <p>Both versions of the program (with comments or uncomment current comments with commenting corresponding lines) compiles well, but when i try to release memory through <code>delete &amp;mp</code> (aka, mp is the std::map itself, not a pointer to std::map), it tells me this strange error message:</p>
  
  <pre><code>test14_1(47555,0x7fff75c6f300) malloc: *** error for object 0x7fff5c601918: pointer being freed was not allocated
  *** set a breakpoint in malloc_error_break to debug
  Abort trap: 6
  </code></pre>
  
  <p>Anybody knows why is this so?</p>