title: Question regarding C++ Lists
body: <p>list dog;
         .............
         ............</p>
  
  <p>So I added many dog objects to it.
     If I call <code>dog.pop_front();</code></p>
  
  <p>Does memory automatically gets deallocated ? For the object that I popped out ?</p>
  
  <p>So If I call</p>
  
  <pre><code>list&lt;Dog*&gt; dog2;
  dog2.push_back(dog.front());
  </code></pre>
  
  <p>and then I will call <code>dog.pop_front()</code> So this will work? I will assume Dog as type struct. </p>