1
我想在我的項目中使用boost :: hash_combine。但是,我無法找到包含此函數的boost庫(庫libboost_functional不存在)。我正在運行Arch。是否有可能我沒有安裝所有庫?要鏈接哪個庫boost :: hash_combine
編輯:
由於sehe指出,包括右頭是關鍵。
#include <iostream>
#include <boost/functional/hash.hpp>
int main() {
int x = 100;
int y = 10;
size_t h = 0;
boost::hash_combine(h, x);
boost::hash_combine(h, y);
std::cout << h << std::endl;
}