This example code is explained in the STXXL Deque section.
#include <iostream>
int main()
{
deque my_deque;
my_deque.push_front(11);
my_deque.push_back(5);
my_deque.push_back(8);
std::cout << "return 'first' element: " << my_deque.front() << std::endl;
std::cout << "return 'last' element: " << my_deque.back() << std::endl;
std::cout << "random access: " << my_deque[2] << std::endl;
while (!my_deque.empty())
{
std::cout << *deque_iterator << " ";
++deque_iterator;
my_deque.pop_front();
}
return 0;
}