Yes, RACK::Remove_Tile() is my original code.
I've added the asserts to try and catch something obvious.
I decided to look at RACK::Find() a little more closely.
RACK::Find() is a simple linear search of the vector.
I know from debugging that the vector has 7 elements.
I added line 3. mv_tiiles.erase(iter) still fails with an out of range error.
1 2 3 4 5 6 7 8
|
tilevec_t::iterator RACK::Find(LETTER ltr)
{
return mv_tiles.begin(); / Added for debugging/testing
for (auto iter = mv_tiles.begin(); iter != mv_tiles.end(); iter++)
if (iter->get_letter() == ltr)
return iter; // Found it
return mv_tiles.end(); // Not found
}
| |
Using lastchance's main(), I have not been able to get the test program to fail.
edit: When I look at vector::erase, the key condition in line 1414 that must be failing is:
|
_Where._Getcont() == _STD addressof(_My_data)
| |
I've checked the remaining two conditions and their values seem reasonable.
I'm slowly coming to the conclusion that I may have trashed something in the vector anchor.
I have no clue how I may have done that.
I wish vector had a function that checks the integrity of the anchor.