okey i am making an library where it is possible to bind a string to a key
take a look at the following function
void InputStates::createMap(const std::string& map,const KeyMapping& key)
{
std::cout << std::endl;
std::unordered_map<std::string, KeyMapping>::iterator i= hasValue(key);
//std::cout << "create map 2" << std::endl;
if(i != mKeyMap.end())
{
//std::cout << "create map 4" << std::endl;
KeyMapping& tmp = mKeyMap[map];
//std::cout << "step 1" << std::endl;
mKeyMap[map] = key;
//std::cout << "step 2" << std::endl;
(*i).second = tmp;
//std::cout << "create map 5" << std::endl;
}else
{
//std::cout << "create map 3" << std::endl;
mKeyMap.insert(std::make_pair(map, key));
}
}
nothing looks wrong does it?
it works perfectly until i remove or comment out the std::cout << std::endl;
at the begining of the function it chrashes the moment the function is called
so please help this is really the strangest problem i have ever seen