The queue is the first-in-first-out version of the stack. In other words, you add to one end and take off from the other, rather than pushing and popping of the same end. Consider the following code sample:
queue<char> my_Fifo; my_Fifo.push( 'a' ); // queue contains 'a' my_Fifo.push( 'b' ); // queue contains 'ab' my_Fifo.push( 'c' ); // queue contains 'abc' char cLook = my_Lifo.front(); // cLook contains 'a' char cLook = my_Lifo.back(); // cLook contains 'c' char cTake = my_Lifo.pop(); // cTake contains 'a', queue 'bc'
Finally, you have the usual operators for testing emptiness and size. Again, you do not have any other operators for adding to, removing from, sorting, or otherwise indexing the data contained inside the queue.