deque进行pop_back()出错
我进行pop_back操作时,出现运行时错误,我晓不得咋个改,但晓得是pop_back出问题,帮我看一下#include <iostream>
#include <deque>
#include <algorithm>
#include <iterator>
#include <time.h>
using namespace std;
enum{SIZE=20};
int main()
{
srand(time(0));
int arr[SIZE];
for (int i = 0; i < SIZE;i++)
{
arr[i] = rand()%100;
}
deque<int>pm;
pm.insert(pm.begin(), arr, arr + SIZE);
for (deque<int>::iterator p = pm.begin(); p != pm.end();p++)
{
cout << "pm:" << *p << endl;
}
/*
pm.push_back(1);
pm.push_back(1);
pm.push_back(1);
pm.push_back(1);
pm.push_back(1);
pm.push_back(1);
*/
sort(pm.begin(), pm.end());
for (int i = 0; i < SIZE;i++)
{
cout << "pm["<<i<<"]:" << pm[i] << endl;
}
//pm.pop_back();
pm.pop_back();
for (int i = 0; i < SIZE; i++)
{
cout << "pm[" << i << "]:" << pm[i] << endl;
}
while (1);
return 0;
}