gpt4 book ai didi

c++ - 如何在 XCode、C++ 中使用 ext、tr1 或 __gnu_cxx #include hash

转载 作者:行者123 更新时间:2023-11-30 03:04:01 25 4
gpt4 key购买 nike

我正在尝试使用 google-sparsehash library我想包括链接中描述的哈希库,

using ext::hash;  // or __gnu_cxx::hash, or maybe tr1::hash, depending on your OS

我已经尝试了每一种:

#include <ext/hash>
#include <ext>
#include <__gnu_cxx>
#include <tr1>

其中没有一个适用于 XCode。我也“使用”,有人告诉我 __gnu_cxx 不包含“哈希”。如何在 OS X (10.6.8) 上向 XCode (3.2.6) 描述这个库?

或者更一般地说,这个散列函数在 Mac/XCode 中的什么地方被描述?

最佳答案

在 C++11 中:

#include <functional>
using std::hash;

在带有 TR1 的 C++03 中:

#include <tr1/functional>
using std::tr1::hash;

关于c++ - 如何在 XCode、C++ 中使用 ext、tr1 或 __gnu_cxx #include hash,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9005256/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com