Software Engineering Swapping a queue in C++ STL In this article, we will explore examples of swapping queues. We can swap a queue in C++ STL in two ways using std::queue::swap and using std::swap.