void deque<X,A>::shrink_to_fit();
#include <deque>
#include <iostream>
#include <deque>
int main()
{
using namespace std;
// Create a deque instance
deque<char> qD;
qD.push_back('X');
qD.push_back('o');
qD.push_back('a');
qD.push_back('X');
qD.push_back('.');
qD.push_back('n');
qD.push_back('e');
qD.push_back('t');
// Output the capacity before and after shrinking
cout << "Size = " << qD.size() << endl;
qD.shrink_to_fit();
cout << "Size = " << qD.size() << endl;
// Keep the window open
cin.get();
return 0;
}
© 20072025 XoaX.net LLC. All rights reserved.