destroying object in vector when new object added
<p>When push_back method of vector is called the previous object in the vector is getting destroyed  what might be the reason for this.</p>

<pre><code>template&lt;typename type&gt; void SomeList&lt;type&gt;::AddElement(type &amp;inObject)
{
    pList.push_back(inObject);// pList is member of my class Vector SomeList 
}
</code></pre>
