title: C++ std::map memory management
body: <p>I have following C++ code</p>
  
  <pre><code>map&lt;long, TelemInfoV01&gt; LastTelemetry;
  
  void UpdateTelemetry( const TelemInfoV01 &amp;info )
  {
      LastTelemetry[info.mID] = info;
  }
  </code></pre>
  
  <p>where TelemInfoV01 is a struct</p>
  
  <p>The UpdateTelemetry method is called outside of my code, passing a value, that I cache and use later. How does the map manage memory? Is it copying the struct in same way, do I have to delete it manually after removing from the global LastTelemetry map? </p>
  
  <p>I do not control the scope of the 'info' variable coming into the method. I just want to cache it's value to use it in a different call.</p>
  
  <p>The main reason for asking is that I have some memory leaks and would like to track it down.</p>
  
  <p>Thanks,
  Stevo</p>