unordered-set

unordered-set

文章 0 浏览 6

BOOST :: UNOREDED_MAP-需要为哈希std :: set< int'指定自定义哈希功能?

我想使用 boost :: unordered_map< key,value> ,其中 key 是 std :: set&lt< int> 。由于一组整数不是内置类型,所以我以为我必须…

世俗缘 2024-12-05 06:41:05 8 0

unordered_map / unordered_set 中元组的通用哈希

为什么 std::unordered_map, string> 不只是 开箱即用? 必须为 tuple 定义哈希函数是很乏味的,例如 template> { size_t operator()(std::tuple cons…

故事还在继续 2024-11-30 01:32:32 6 0

size_t:运算符? (以及使用 unordered_set 的方法)

什么是 operator size_t () const 环境:Visual Studio 2010 Professional TL; DR 今天我正在寻找一种使用 std::tr1::unordered_set 的方法。因为我询…

子栖 2024-11-18 22:39:28 7 0

无序集(const char)比无序集(字符串)慢得多

我正在将一个很长的列表从磁盘加载到一个 unordered_set 中。如果我使用一组字符串,速度会非常快。大约 7 MB 的测试列表在大约 1 秒内加载。然而,使…

听不够的曲调 2024-11-18 05:30:54 8 0

C++:shared_ptr 作为 unordered_set 的键

考虑下面的代码 #include #include #include int main() { boost::unordered_set s; s.insert(5); s.insert(5); // s.size() == 1 boost::unordered_s…

厌味 2024-11-16 10:23:07 14 0

boost/unordered_set: mingw () 编译错误

我有一段使用boost的unordered_set的代码, #include boost::unordered_set mySet(100); 它可以在unix下与gcc编译并正常工作。当我尝试使用 mingw32 (…

青春有你 2024-11-15 08:11:39 9 0

提升无序集不起作用

我是新手,要加强。我正在尝试实现 boost::unorder_set。这是代码: struct point { int x; int y;}; bool operator==(point const& p1, point const&…

夏了南城 2024-11-09 06:27:21 9 0

哈希表和二维向量

我想将二维向量逐行推入哈希表,然后在哈希表中搜索行(向量)并希望能够找到它。我想做一些事情,比如 #include #include #include using namespace …

云归处 2024-10-10 23:49:10 13 0

C++ 的随机唯一子集的最快方法tr1 无序集

这个问题与 这个,更准确地说是这个答案。 这里是:我有一个无符号整数的 C++/TR1 unordered_set U (粗略基数 100-50000,粗略值范围 0 到 10^6)。 …

一场春暖 2024-10-08 04:04:51 13 0

Boost - unordered_set 教程/示例/有什么吗?

我想在项目中使用 unordered_set 。 然而,它的文档要么不完整,要么只是技术参考,没有示例。 任何人都可以提供处理该问题的在线资源的链接吗?也欢…

最近可好 2024-10-07 02:52:48 10 0

使用 unordered_set 防止不同哈希值的键落在同一个存储桶中

这可能是一个愚蠢的问题,但这里是: 我将字典哈希到基于 unordered_set 的哈希表中。我的哈希函数被故意设置为“坏”,因为包含同一组字母的所有字符…

二手情话 2024-09-29 15:31:46 14 0

将 boost::unordered_set 作为结果映射传递给 boost::split

有谁知道将 boost::unordered_set 作为第一个参数传递给 boost::split 是否合理?在 libboost1.42-dev 下,这似乎会引起问题。这是一个导致问题的小示…

扭转时空 2024-09-28 12:08:59 10 0

C++ STL 容器中的 NULL 指针

不幸的是,我并没有完全开发自己开发的程序。 我最近注意到 unordered_set 的运算符 -- 上出现 Visual Studio 致命错误,该错误是通过简单插入指向 un…

乜一 2024-08-18 02:35:38 21 0

boost::thread::id 的 tr1::hash 吗?

我开始使用 tr1 命名空间中的 unordered_set 类来加速对普通(基于树)STL map 的访问。 然而,我想在 boost (boost::thread::id) 中存储对线程 ID 的…

神魇的王 2024-07-17 08:53:30 14 0
更多

推荐作者

alipaysp_snBf0MSZIv

文章 0 评论 0

梦断已成空

文章 0 评论 0

瞎闹

文章 0 评论 0

寄意

文章 0 评论 0

似梦非梦

文章 0 评论 0

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