Strange Assertion error.

I set up a string list like

1
2
3
4
#include<string>
#include<list>

std::list<std::string> mylist;

This is created inside another class/object, which isn't dynamically allocated and normal patterns of fall out should clean things up without asserting.

In the destruction of the base object I am getting a assertion for an empty string list, which was created and never manipulated. How am I getting this? Sample code I have seen shouldn't give me this case. What am I missing? The code lets the Stl handle all memory stuff.

The compiler is GCC on MinGW
Is it received as a warning or an error?
No Error or warning on it. The code compiles cleanly.

It is an Run time assertion. When I stepped to the Assertion point it was somewhere in std::list's template. I didn't find out exactly where.

It is a very simple program at this point, which is going to get a lot more complex.
If you add a string to the list, does the message still happen?

I had no messages or assertions when I ran that code. =\

Using MinGW from the source repository.
Last edited on
for some reason I expanded the code a little bit, cleaned the build and rebuilt. The strange assertion went away.

Its not the first time doing what I read out of documentation is possible and get strange quirks until I add a simple cout to see what's actually happening in my code. The code works as expected.
Topic archived. No new replies allowed.