Hi,
in this simple peace of code I compare std::string's for equality:
I've checked the values of the two compared strings inside the debugger. They are 100% equal (or I got crazy somehow) but the operator returns false. I guess I'm doing something really stupid but I'm unable to see what this morning.Code:const int UserTypes::getInt(const std::string& str) const throw(NoExistingTypeException) { for ( std::map<int, std::string>::const_iterator citer = mUserTypesMap.begin(); citer != mUserTypesMap.end(); ++citer ) { if(citer->second == str) { return citer->first; } } throw NoExistingTypeException(); }
Thank you in advance!