Mercurial > hg > octave-lyh
diff src/base-list.h @ 6841:9cee629fe20c
[project @ 2007-08-29 17:31:45 by jwe]
author | jwe |
---|---|
date | Wed, 29 Aug 2007 17:31:45 +0000 |
parents | 4c8a2e4e0717 |
children | 8d3426c59a88 |
line wrap: on
line diff
--- a/src/base-list.h +++ b/src/base-list.h @@ -42,7 +42,27 @@ iterator erase (iterator pos) { return lst.erase (pos); } template <class P> - void remove_if (P pred) { lst.remove_if (pred); } + void remove_if (P pred) + { + // We would like to simply call + // + // lst.remove_if (pred); + // + // but the Sun Studio compiler chokes on that. + // + // FIXME -- this kluge should be removed at some point. + + iterator b = lst.begin (); + iterator e = lst.end (); + while (b != e) + { + iterator n = b; + n++; + if (pred (*b)) + erase (b); + b = n; + } + } void clear (void) { lst.clear (); }