|
|
|
|
Runter
Wizard


Group: Members
Posts: 1,850
Joined: Jun 1, 2006
|
#18 id:36911 Posted Oct 29, 2009, 5:38 am
|
David Haley said:Indeed, it's not an easy conversion. My policy is to not go in and convert everything, but instead when I add new fields, to use the string classes.
That's precisely what I have done in the past. Not much extra work either.
|
......................... CoralMud project
For once you have tasted flight Ruby you will walk the earth with your eyes turned skywards,
for there you have been and there you will long to return. --
Leonardo Da Vinci Yukihiro Matsumoto
|
|
Kaz
Magician


Group: Members
Posts: 53
Joined: Oct 31, 2009
|
#19 id:37002 Posted Oct 31, 2009, 4:44 am
|
I gave a longer e-mail to Kayle because I had some registration problems, but thought I'd post for the benefit of all anyway.
I think the problem is that remove() doesn't remove() - it just moves all elements with a certain pattern to the end of the list and returns an iterator to the first (re)moved element. So, by iterating through the list, deleting each and then moving it to the end, you're eventually going to delete one of the elements you removed.
In this case, either erase() should be used (careful, because it invalidates the current iterator and returns a valid iterator to the next element) or just delete them and leave them because it's a destructor and the list will clean itself up.
|
|
|
|
|
Kaz
Magician


Group: Members
Posts: 53
Joined: Oct 31, 2009
|
#21 id:37021 Posted Oct 31, 2009, 5:40 pm
|
Hmm. Right you are. It does invalidate the iterator, however.
|
|
|
|
|