Check out example codes for "restting a queue stl". It will help you in understanding the concepts better.

Code Example 1

// To clear the queue Q defined as "queue<int> Q"
Q = queue<int>();

Learn ReactJs, React Native from akashmittal.com