stl::map insert segmentation fault
Posted
by Jakub Czaplicki
on Stack Overflow
See other posts from Stack Overflow
or by Jakub Czaplicki
Published on 2010-05-30T20:59:16Z
Indexed on
2010/05/30
21:02 UTC
Read the original article
Hit count: 310
Why does this code stop with the segmentation fault :
class MapFile
{
public:
/* ... */
std::map <unsigned int, unsigned int> inToOut;
};
bool SwitchMapFile::LoadMapFile( const wxString& fileName )
{
/* ... */
inToOut.insert( std::make_pair(spmPort,fibreId) );
}
but this one works fine :
class MapFile
{
public:
/* ... */
};
bool MapFile::LoadMapFile( const wxString& fileName )
{
/* ... */
std::map <unsigned int, unsigned int> inToOut;
inToOut.insert( std::make_pair(input,output) );
}
?
© Stack Overflow or respective owner