title: How to delete dynamic allocated class object in list<T>?
body: <p>I just create list of Coordi object as below inside of a functions. Coordi is class object which I defined.</p>
  
  <pre><code>list&lt;Coordi&gt; LstOfCoordi;
  for (int i = 0; i &lt; 10; ++i)
  {
      Coordi *tmp = new Coordi();
      LstOfCoordi.push_back(tmp);
  } 
  </code></pre>
  
  <p>I want release the list and each objects to the system before program termination. </p>
  
  <p>If each element of list should have to be released, how to handle it ? I tried to below codes to use delete each of them, but it made compile error.</p>
  
  <pre><code>for (int i = 0; i &lt; 10; ++i)
  {
      myClass tmp = LstOfMyCalss.back();
      delete &amp;tmp;
      LstOfMyClass.pop_back();
  } 
  </code></pre>
  
  <p>So, I am wondering deletion from the list is enough or not.
  At a glance with below codes, each element was allocated and they are not released properly when the list destroyed.</p>
  
  <pre><code>for (int i = 0; i &lt; 10; ++i)
  {
      //myClass tmp = LstOfMyCalss.back();
      //delete &amp;tmp;
      LstOfMyClass.pop_back();
  } 
  </code></pre>
  
  <p>Please let me know the best way to release all allocated objects.</p>