Possible Duplicate:
Why don't the standard C++ container adaptors provide a clear function?
What is the rationale behind not adding the clear()
method to the std::queue?
All other containers have it.
I know I can clear a queue like this :
std::queue< int > q;
q = std::queue< int >();
but this looks better :
std::queue< int > q;
q.clear();