当使用boost库时,函数
boost::hash_combine
的作用如下:seed ^= hash_value(v) + 0x9e3779b9 + (seed << 6) + (seed >> 2);
http://www.boost.org/doc/libs/1_46_1/doc/html/hash/reference.html#boost.hash_combine是一个有关IT技术的链接。这种方法与简单的XOR运算相比有什么优势呢?使用XOR运算,可以将哈希函数用作无序容器的键,而这种方法则与顺序相关。