handle empty vectors in TinySet

This commit is contained in:
Tiago Gomes 2012-05-31 14:57:53 +01:00
parent 7429a39b48
commit 22780c4559

View File

@ -228,9 +228,12 @@ class TinySet
private:
iterator unique_cmp (iterator first, iterator last)
{
if (first == last) {
return last;
}
iterator result = first;
while (++first != last) {
if ( cmp_(*result, *first)) {
if (cmp_(*result, *first)) {
*(++result) = *first;
}
}