comparison liboctave/util/base-list.h @ 17577:c702371ff6df classdef

maint: periodic merge of default to classdef
author John W. Eaton <jwe@octave.org>
date Sat, 05 Oct 2013 11:22:09 -0400
parents 856cb7cba231 81f3b09e3e6e
children 93b3d03b05e7
comparison
equal deleted inserted replaced
17414:20d1b911b4e7 17577:c702371ff6df
47 iterator erase (iterator pos) { return lst.erase (pos); } 47 iterator erase (iterator pos) { return lst.erase (pos); }
48 48
49 template <class P> 49 template <class P>
50 void remove_if (P pred) 50 void remove_if (P pred)
51 { 51 {
52 lst.remove_if (pred);
53
54 // FIXME: kluge removed 8/7/13. Eventually this commented
55 // code should be deleted.
56 //
57 // FIXME: this kluge should be removed at some point.
52 // We would like to simply call 58 // We would like to simply call
53 // 59 //
54 // lst.remove_if (pred); 60 // lst.remove_if (pred);
55 // 61 //
56 // but the Sun Studio compiler chokes on that. 62 // but the Sun Studio compiler chokes on that.
57 // 63 //
58 // FIXME -- this kluge should be removed at some point. 64 // iterator b = lst.begin ();
59 65 // iterator e = lst.end ();
60 iterator b = lst.begin (); 66 // while (b != e)
61 iterator e = lst.end (); 67 // {
62 while (b != e) 68 // iterator n = b;
63 { 69 // n++;
64 iterator n = b; 70 // if (pred (*b))
65 n++; 71 // lst.erase (b);
66 if (pred (*b)) 72 // b = n;
67 lst.erase (b); 73 // }
68 b = n;
69 }
70 } 74 }
71 75
72 void clear (void) { lst.clear (); } 76 void clear (void) { lst.clear (); }
73 77
74 iterator begin (void) { return iterator (lst.begin ()); } 78 iterator begin (void) { return iterator (lst.begin ()); }