http://www.cplusplus.com/reference/string/string/erase/
pos
Position within the string of the first character to be erased.
If the position passed is past the end of the string, an out_of_range exception is thrown.
I see no checking for this condition and I see no catching of any exceptions, so if this is in fact occurring, it would certainly "terminate in a special way". Confirm that this doesn't happen or make sure you prevent and / or handle it.
VernonDozier
Posting Expert
5,527 posts since Jan 2008
Reputation Points: 2,633
Solved Threads: 711