I have a
std::map<std::string, myClass*> myMap
then I am inserting like follow:
if(!myKey.empty())
{
myMap[myKey] = this;
}
This sometime is throwing a segmentation fault.
Why??
I have a
std::map<std::string, myClass*> myMap
then I am inserting like follow:
if(!myKey.empty())
{
myMap[myKey] = this;
}
This sometime is throwing a segmentation fault.
Why??
Maybe your myMap is no longer accessible. For instance, it might be a reference to a deleted pointer, or, much more probable, a member variable of an already deleted class: