1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
|
// deque::max_size
#include <iostream>
#include <deque>
int main ()
{
unsigned int i;
std::deque<int> mydeque;
std::cout << "Enter number of elements: ";
std::cin >> i;
if (i<mydeque.max_size()) mydeque.resize(i);
else std::cout << "That size exceeds the limit.\n";
return 0;
}
| |