Hi
I've been using a
boost::unordered_map <const char *,std::vector <const char *> > to store data coming from a file.
My problem is that the comparison between the keys of the map is not working as I'd expect..
For example, in the file I have a key whose name is "block_size" that is stored correctly in the map and its associated vector is stored correctly in the map with no problems.
But when I run a get ("block_size") in my map, it says it could not find that key in the map, although right before running the get function I had checked the entire map and made sure that the key was there along with its
associated vector.
I've made some research and found out that it could be needed to inform the map which comparison function it should use to compare the keys. I then started using a
boost::unordered_map <const char *,std::vector ><const char *>, boost::hash<const char *>,eqstr >
And my eqstr is like this:
But now something weird is happening..I run the same exact code many times..and each time I get a different result..sometimes it finds the key in the map..sometimes it says the key is not there.. the same exact code..
with no changes..shows different results each time I run it...how could that be?
I even tried using std::equal_to<const char *> to compare the keys, but then my map can't ever find the key although I'm sure it is there... has anyone seen this before?