If (for example) the new max_size must be 5 then at the end the queue.size() must be <= 5, so the exit condition must be <=, so the continuing condition must be > (and not >= as it was).

This commit is contained in:
xanatos 2012-06-19 09:48:00 +03:00
parent 4c6b210af0
commit 16d5671943
1 changed files with 1 additions and 1 deletions

View File

@ -51,7 +51,7 @@ public:
size_type max_size(size_type s)
{
if (s)
while (queue.size() >= s)
while (queue.size() > s)
{
set.erase(queue.front());
queue.pop_front();