#include<iostream>
#include<vector>
using namespace std;
struct A
{
A(int id=10):m_id(id){}
void show(){
cout<< "m_id is " << m_id <<endl;
}
int m_id;
};
int main(void)
{
vector<A*> pVec;
const int value = 10;
for(int i=0; i < value; i++)
pVec.push_back(new A(i));
vector<A*>::iterator Iter=pVec.begin();
for(;pVec.end() != Iter; Iter++)
{
(*Iter)->show();
delete *Iter;
*Iter = NULL;
}
pVec.clear();
cout<<" size(): "<< pVec.size() << "\tand capacity(): " << pVec.capacity() << endl;
vector<A*>().swap(pVec);
cout<<" size(): "<< pVec.size() << "\tand capacity(): " << pVec.capacity() << endl;
return 0;
}