Kayle
Wizard


Group: Members
Posts: 979
Joined: Nov 27, 2006
|
#16 Posted Oct 28, 2009, 4:46 pm
|
Yeah, Baby steps. std::string and the like are not something that's particularly friendly to stuff into Diku if I recall correctly from when Samson did it for AFKMud.
|
......................... Owner/Coder Coder
Malevolent Whispers Star Wars: The Sith Wars
{Development Phase - Not accepting players} Open Alpha - Players Welcome - Full System Re-writes Imminent.
IMC2 Contact: Kayle@MW
FUSS Project Team Lead
SmaugMuds.Org - The Smaug MUDs Community Center
|
|
|
|
Runter
Wizard


Group: Members
Posts: 1,074
Joined: Jun 1, 2006
|
#18 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.
|
|
......................... -Heath
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
Fledgling

Group: Members
Posts: 5
Joined: Oct 31, 2009
|
#19 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
Fledgling

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