#include
#include
#include
using namespace std;
int main( )
{
const int big_size = 10000;
vector v( big_size );
// make a big vector and then minimize its memory
v.assign( big_size, 3.33 );
cout << "\n\nBefore resizing, the capacity of the vector is "
<< v.capacity() << " and its size is " << v.size();
v.resize( 1 );
cout << "\nAfter resizing, the capacity of the vector is "
<< v.capacity() << " and its size is " << v.size();
vector( v ).swap( v );
cout << "\nAfter swapping, the capacity of the vector is "
<< v.capacity() << " and its size is " << v.size();
}