L
linq936
Hi,
I have a simple code like this,
int NodeRepo::storeNode(MyString key, MyNode* node){
this->nodeMap.insert(make_pair(key, node));
return 0;
}
In class MyString, there is operator < defined.
But the problem crashes when it comes to this function on Windows. I
launtch the VC debugger, I can see that the 2 arguments of the function
are all right, I checked their values.
The crash comes from some code in STL, make_pair() does return some
value, and then it comes to this STL function,
template <class _Key, class _Value, class _KeyOfValue,
class _Compare, class _Alloc> pair< _Rb_tree_iterator<_Value,
_Nonconst_traits<_Value> >, bool>
_Rb_tree<_Key,_Value,_KeyOfValue,_Compare,_Alloc> ::insert_unique(const
_Value& __v)
{
_Link_type __y = this->_M_header._M_data;
...
}
The crash is because this->_M_header is pointing to some garbage.
I am not sure what this means.
Could you give me some pointer?
I have a simple code like this,
int NodeRepo::storeNode(MyString key, MyNode* node){
this->nodeMap.insert(make_pair(key, node));
return 0;
}
In class MyString, there is operator < defined.
But the problem crashes when it comes to this function on Windows. I
launtch the VC debugger, I can see that the 2 arguments of the function
are all right, I checked their values.
The crash comes from some code in STL, make_pair() does return some
value, and then it comes to this STL function,
template <class _Key, class _Value, class _KeyOfValue,
class _Compare, class _Alloc> pair< _Rb_tree_iterator<_Value,
_Nonconst_traits<_Value> >, bool>
_Rb_tree<_Key,_Value,_KeyOfValue,_Compare,_Alloc> ::insert_unique(const
_Value& __v)
{
_Link_type __y = this->_M_header._M_data;
...
}
The crash is because this->_M_header is pointing to some garbage.
I am not sure what this means.
Could you give me some pointer?