I’m writing an application, where I want to store strings as keys ans a custom Object as value
multimap<string, owncreatedobject> mymap;
Compiling does well, but I get a “Segmentation fault” when using the function insert
during runtime.
mymap.insert(string,myobject); --> Segmentation Error
A already added a copyconstructor an assignmentfunction (which calls the copyconstructor)
any idea about the “Segmentation fault?
I fiddle with your problem for the last hour and I think I got it.
Try using something in the matter of this code segment:
In your given example you tried to insert without an iterator. The first element for a 2 element insert call for a multimap is the iterator. That’s the reason for your segmentation fault and why one should use pair.