EDITOR: decided, I know how, but I donโt understand why.
I changed the declaration of variables from
tr1::unordered_map<int,T> variables;
to
unordered_map<int,T> variables;
and it works great.
If you know why, please write in the answers.
I have a very large program, so I donโt know what code I need to bring here.
There is an abstract class that inherits a derived class. In the abstract there is unordered_map<int,int> (template) as a private member and the public insert(int,int) method.
The resulting class uses the insert base class method to insert elements into the container unordered_map<int,int> ,
The first int used as a counter and starts at 0. The first eleven plug-in elements go OK, but in the 12th element I get sigsegv and an error in struct equal_to in stl_function.h (209).
In the debugger, I saw that unordered_map bucket_count is 11, maybe it tells something.
My compiler is gcc 4.6.1.
Maybe you can even write what sigsegv can call in unordered_map.insert ?
Thank you and regret my poor English.
I will bring specific code if I know which one.
EDIT: This is the insert method:
virtual void Insert(int arrayPlace, T value) { if (!isReadOnly) { if (IsValueDataValid(value)) { variables[arrayPlace] = value; } else { throw 2; } } else { throw 4; } };
Ad:
tr1::unordered_map<int,T> variables;
sigsegv happend when arrayPlace == 11, and it doesn't matter what value is.