#include
#include
#include
using namespace std;
int main()
{
deque dequeObject1;
char str[] = "Using a deque.";
int i;
for(i = 0; str[i]; i++) {
dequeObject1.push_front(str[i]);
dequeObject1.push_back(str[i]);
}
cout << "Original dequeObject1:\n";
for(i = 0; i cout << dequeObject1[i];
cout << "\n\n";
for(i = 0; i dequeObject1.pop_front();
cout << "dequeObject1 after popping front:\n";
for(i = 0; i cout << dequeObject1[i];
cout << "\n\n";
deque dequeObject2(dequeObject1);
cout << "dequeObject2 original contents:\n";
for(i = 0; i cout << dequeObject2[i];
cout << "\n\n";
for(i = 0; i dequeObject2[i] = dequeObject2[i]+1;
cout << "dequeObject2 transposed contents:\n";
for(i = 0; i cout << dequeObject2[i];
cout << "\n\n";
deque::iterator p = dequeObject1.begin();
while(p != dequeObject1.end()) {
if(*p == 'a') break;
p++;
}
dequeObject1.insert(p, dequeObject2.begin(), dequeObject2.end());
cout << "dequeObject1 after insertion:\n";
for(i = 0; i cout << dequeObject1[i];
cout << "\n\n";
return 0;
}