vendredi 30 janvier 2015

std::queue::size() can return a huge number after pop() of size() == 0

I have the link here where I push(x) 10 ints, then pop() 11 and the size is not 0, or an exception, but a tremedous number (probably == std::numeric_limit<size_type>::max()). I assume this is the consequence of the internal representation simply doing a size-- and not checking for an already empty() case. This seems like a bug in the stdc++ library.


http://ift.tt/1yVzVEz


Aucun commentaire:

Enregistrer un commentaire