I have a pair
I know the value of the pair.first cannot be more than 1000.
I also know that the pair.second , the string, is always 1 word. Never more than 1 word.
So, to construct the Hash value for the pair I am doing the following:
pair<int,string> p;
hash<char*> H;
hash_vale = H(p.second)*1000 + p.first;
I think this will give unique values as long as the hash value of strings is not too huge and that H(p.second) will give 1-1 mappings. Are these assumptions valid?
Thanks,