void JobQueue ::clearJobs()
 {
  // I want to avoid pop in a loop
    while (!m_Queue.empty())
    {
        m_Queue.pop();
    }
}

int main() {
    queue <int> q1;
    // stuff
    q1 = queue<int>();  
}

#include <algorithm>

void clear( std::queue<int> &q )
{
   std::queue<int> empty;
   std::swap( q, empty );
}

출처 : https://stackoverflow.com/questions/709146/how-do-i-clear-the-stdqueue-efficiently

+ Recent posts