Work around buggy list::remove in libc++

This commit is contained in:
rdb 2015-03-31 13:55:32 +02:00
parent af0d853eef
commit 346d04a256
1 changed files with 13 additions and 0 deletions

View File

@ -49,6 +49,19 @@ public:
typedef TYPENAME base_class::const_iterator const_iterator;
typedef TYPENAME base_class::reverse_iterator reverse_iterator;
typedef TYPENAME base_class::const_reverse_iterator const_reverse_iterator;
// This exists because libc++'s remove implementation has a bug with
// Panda's allocator class.
INLINE void remove(const Type &val) {
iterator it = this->begin();
while (it != this->end()) {
if (*it == val) {
it = this->erase(it);
} else {
++it;
}
}
};
};
#endif // USE_STL_ALLOCATOR