why destruction is called?
<p>I don't know why the destruction of an object in vector is called at the following point of time. </p>

<pre><code>class Something
{
public:
    Something() {}
    ~Something()    { cout &lt;&lt; "destruction called" &lt;&lt; endl; }
};

int main()
{
    std::vector&lt;Something&gt; vec;
    Something sth1 = Something();   
    Something sth2 = Something();
    vec.push_back(sth1);
    vec.push_back(sth2);
    vec.clear();
}
</code></pre>

<p>After I push sth2, destruction for sth1 is called. Why? Shouldn't sth1 be kept in vec[0]?</p>
