【发布时间】:2016-06-12 10:54:38
【问题描述】:
我想在我的项目中使用 boost::hash_combine。但是,我无法找到包含此函数的 boost 库(库 libboost_functional 不存在)。我正在运行 Arch。是否有可能我没有安装所有库?
编辑:
正如 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;
}
【问题讨论】: