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:
parent
4c6b210af0
commit
16d5671943
1 changed files with 1 additions and 1 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Reference in a new issue