stl vectors add sequence
<p>Iam using borland 2006 c++ </p>

<pre><code>class A
{
private:
    TObjectList* list;
    int myid;
public:
 __fastcall A(int);
 __fastcall ~A();
};

__fastcall A::A(int num)
{
    myid = num;
   list = new TObjectList();
}

__fastcall A::~A()
{
}

int main(int argc, char* argv[])
{
  myfunc();
  return 0;
}

void myfunc()
{
    vector&lt;A&gt; vec;
    vec.push_back(A(1));
}
</code></pre>

<p>when i add a new object A to the vector, it calls its destructor twice, and then once when vec goes out of scope , so in total 3 times.</p>

<p>I was thinking it should call once when object is added, and then once when vec goes out scope.</p>
