You probably corrupted an object somewhere with an out-of-bounds write.
I *have* seen a case where a shared pointer to an object containing another shared pointer and so on (basically a linked list) errored on destruction due to stack overflow trying to destroy all the shared_ptrs. But if that isn't your problem then it's probably some form of corruption.
When you say corruption you mean something perhaps trying to destruct an object twice? Like perhaps the delim_list destructor of the elements of the vector get called before the shared_ptr goes out of scope, or vis-versa.
Just for clarity this is the delim_list classes declaration;
//This is a virtual function called from the constructor of CSV_File.
void CSV_File::load_data(ifstream& csv_file)
//loop through lines in a file and add lines to row_data
counted_ptr<delim_list> insert_list(new delim_list(line, ','));
So no shared pointer in whats being pointed to. So it must be some sort of corruption. I was a little worried about creating the string 'line' on the stack and then passing it by reference into the constructor for delim_list to create the vector elements, but I think its okay.
It looks like I misplaced the location of the error, but its still puzzling. I have a std::auto_ptr to that delim_list class that I declare as a class variable and set during construction. But it is inaccessible after that.
The part of the constructor that sets it looks like this.
//variables line and cell are local to the constructor
//load the line into a string stream
header = new delim_list(line, ',');
When I call the to_string method (posted earlier) of the delim_list object referenced by the auto_ptr, I get access memory violations. This same problem causes the code to throw an error when the auto_ptr goes out of scope.