A queue mimic a physical queue. Each new object become the back of the queu,
the object at the front will always leave the queue first.
Operate in a FIFO context.
Include the queue library.
#include <queue>
std::queue<std::string> waiting_line;
Note: the type of the queue cannot be changed after the declaration.
Use .push() to insert a new element at the end of the queue.
waiting_line.push("Bob");
Use .pop() to removes the oldest element.
waiting_line.pop();
Only the first and last element are accessible.
Use .front() and .back()
std::cout << waiting_line.front();
std::cout << waiting_line.back();
Use .size() to get the number of element.
Use .empty() to know if a queue is empty or not.
Return 0 if empty, 1 if not.