What is the shortest, most cross-platform way to make a std::unordered_set CASE-INSENSITIVE container?
my_set.insert("Apples");
my_set.insert("apples"); //Insert doesn't occur because of duplicate item
I know STL provides Hash and Pred. What should Hash be? What should Pred be? if they are not-builtins then please provide the code for them along with an example of their use (i.e. how do I declare std::unordered_set
?).
Due to the Criticism I will elaborate on what I am trying to do. I need a high performance transparent HTTP proxy server, one of the things it does is looks up HTTP header fields quickly. HTTP header fields are defined as being case-insensitive so I need a case-insensitive container.