//----------------------------------------------------------------------------- // name: queue.cpp // desc: basic STL queue example // // Music 256a, Fall 2009, Stanford University // http://ccrma.stanford.edu/courses/256a-fall-2009/ // // compile: // g++ -o queue queue.cpp // run: // ./queue //----------------------------------------------------------------------------- #include #include using namespace std; // entry point int main() { // instantiate a queue of int's queue q; // push q.push( 1 ); q.push( 2 ); q.push( 3 ); q.push( 4 ); q.push( 5 ); // drain the queue while( !q.empty() ) { cerr << q.front() << endl; q.pop(); } return 0; }