本文介绍了如何#include哈希与ext,tr1或__gnu_cxx在XCode,C + +的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我尝试使用 google-sparsehash库 a>并且我想包括链接中描述的散列库,
I'm trying to work with the google-sparsehash library and I'd like to include the hash library described in the link,
using ext::hash; // or __gnu_cxx::hash, or maybe tr1::hash, depending on your OS
've tried one of each:
and I've tried one of each:
#include <ext/hash>
#include <ext>
#include <__gnu_cxx>
#include <tr1>
无法与XCode配合使用。我也有使用,在那里我被告知,__gnu_cxx不包含哈希。如何描述这个库到XCode(3.2.6)在OS X(10.6.8)?
which none worked with XCode. I've also "using", where I was told that __gnu_cxx does not contain "hash". How do I describe this library to XCode (3.2.6) on OS X (10.6.8)?
或者更一般地说,在Mac / XCode中描述的这个散列函数在哪里?
Or more generally, where is this hash function described in a Mac / XCode?
推荐答案
在C ++ 11中:
#include <functional>
using std::hash;
在带有TR1的C ++ 03中:
In C++03 with TR1:
#include <tr1/functional>
using std::tr1::hash;
这篇关于如何#include哈希与ext,tr1或__gnu_cxx在XCode,C + +的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!