std::map compare function function and NULL
I've written a compare function for a std::map so I can have custom key
types.
class GGDictionaryMapCompare
{
public:
bool operator()(GGString * lhs, GGString * rhs)
{
return strcmp(lhs->str(), rhs->str()) < 0;
}
};
The issue is that the lhs is coming in NULL. I never insert a NULL into
the map, so this should not be happening. Any idea why? Or am I just doing
the compare function wrong? I can protect against getting NULL, but it
seems like something is wrong and I don't want to cure a symptom and not
the problem.
Thanks
No comments:
Post a Comment