如何在VS2005中使用sgi hash_table?

发布于 2024-07-07 22:34:57 字数 152 浏览 8 评论 0原文

我在VS2005中编写了一个C++项目,并使用了大量的STL容器及其附加的STL。 但是,我发现VS2005中的STL中没有hash_map,我想使用SGI hash_map。 如何更改我的项目以使用 SGI STL?

感谢布莱恩的方法,它有效! 这很简单。

I wrote a C++ project in VS2005, and used lots of STL container with its plus-in STL. However, I found STL in VS2005 does not have a hash_map in it, I want to use SGI hash_map. How can I change my project to use SGI STL?

Thanks for Brian's method, it works! And it's simple.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

最近可好 2024-07-14 22:34:57

VS2005确实有一个hash_map:

#include <hash_map>
stdext::hash_map

如果你仍然想要,你可以在这里下载sgi stl< /a>. 您应该能够将包含目录设置为 sgi 位置。 它将优先于 VC++ 全局包含目录。

VS2005 does have a hash_map:

#include <hash_map>
stdext::hash_map

If you still want to though you can download the sgi stl here. You should be able to just set the include directory to the sgi location. It will take precedence over the VC++ global include directories.

过期以后 2024-07-14 22:34:57

我不知道 VS2005 是否有 TR1,但如果有(或者如果您后来决定使用另一个有它的编译器),您可以使用 unordered_map

#include <tr1/unordered_map>
std::tr1::unordered_map mymap;

另外,为了完整起见,GCC(它曾经用于有 ) 在 上有 hash_map(在不同的命名空间上)。 在最新的 GCC 版本中,您还可以使用

I do not know if VS2005 has TR1, but if it has (or if you later decide to use another compiler which has it), you can use unordered_map:

#include <tr1/unordered_map>
std::tr1::unordered_map mymap;

Also, for completeness, GCC (which used to have <hash_map>) has hash_map on <ext/hash_map> (on a different namespace). On recent GCC releases, you can also use <tr1/unordered_map>.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文