Ok, so this time I'm working with a vector since cire pointed out that my lernin' there was wrong! I'm working on the constant problem over in http://www.cplusplus.com/forum/general/95710/. I went ahead and designed a class that acts as a constant containing an int and string. It can only be initialized using a constructor, and cant be changed except to be deleted. This ensures that the contents act as constants throughout most of the remainder of the program.
I'm overloading = for the container class. It's only private data member is a vector<Constant> named Const. Here's the operator's code:
I'm getting the error because the while loop in the = operator function isn't ending. This is similar to the loop that cire suggested for my first problem, and I had assumed that the iterators would behave the same for a vector as they did for a list. However, this is what the console looks like when the error gets thrown:
So it looks like the code is looping through the vector indefinitely until it reaches some upper limit where it finally throws the exception. I'm at a loss to figure out what's happening. Shouldn't the comparison in the While stop it when it reaches the 4th element?
Or for that matter... why implement this operator at all? The compiler provided default assignment operator will do exactly what that does. You don't have to code this manually.