Παράδειγμα 1: ουρές
Το παρακάτω παράδειγμα ορίζει μια διπλή ουρά ακεραίων, προσθέτει 5 στοιχεία
και τα τυπώνει:
#include <iostream>
#include <deque>
using namespace std;
typedef deque <int>  INTDEQUE;
void main()
{
        // Create A and fill it with elements 1,2,3,4 and 5
        // using push_back function
        INTDEQUE  A;
        A.push_back(1);
        A.push_back(2);
        A.push_back(3);
        A.push_back(4);
        A.push_back(5);
        // Print the contents of A using iterator
        // and functions begin() and end()
        INTDEQUE::iterator pi;
        for (pi = A.begin();  pi != A.end(); pi++)
                cout << *pi << " ";
        cout << "\n";
}