
Since many applications depend on case-insensitive searches, it might be a good idea to define a hash object ihash that converts an input string to lower case before calling the standard hash function on it. It could be used with the is_iequal predicate from the string algorithm library in hash_sets, hash_maps, etc. Joe Gottman

Joe Gottman wrote:
Since many applications depend on case-insensitive searches, it might be a good idea to define a hash object ihash that converts an input string to lower case before calling the standard hash function on it. It could be used with the is_iequal predicate from the string algorithm library in hash_sets, hash_maps, etc.
I'm going to have one in the examples for the unordered associative containers. If there's interest in making this part of boost proper I suppose that's a possibility. You can see the example on the page at: http://daniel_james.fmail.co.uk/unordered/hash_equality.html The code on that page hasn't been tested yet, so there's a good change that it contains embarrassing bugs. An official version would need to be made generic and work with locales. I didn't do this, as I wanted to keep it simple, but I could include a full-featured version as well. Daniel
participants (2)
-
Daniel James
-
Joe Gottman