1

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();
Community
  • 1
  • 1
BЈовић
  • 62,405
  • 41
  • 173
  • 273

0 Answers0