1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
|
// unordered_map::hash_function
#include <iostream>
#include <string>
#include <unordered_map>
typedef std::unordered_map<std::string,std::string> stringmap;
int main ()
{
stringmap mymap;
stringmap::hasher fn = mymap.hash_function();
std::cout << "this: " << fn ("this") << std::endl;
std::cout << "thin: " << fn ("thin") << std::endl;
return 0;
}
| |