TBB 并发哈希映射模板参数
TBB concurrent hash map template arguments
我正在尝试使用 TBB concurrent_hash_map容器。在这个例子之后,表明我需要 3 个类型参数(模板参数)、键和值类型以及特征类型 HashCompare。在此链接中,它说HashCompare具有基本类型的默认值。
但是,当尝试以两种方式(2 或 3 个模板参数)中的任何一种使用它时,我收到有关"模板参数太少,预期为 4"的错误 - 实际上,在挖掘代码时,我能找到的头文件中concurrent_hash_map的唯一定义有四个参数:
class concurrent_hash_map<Key,T,HashCompare,Allocator>
我错过了什么,这个例子已经过时了吗?
在某处还有另一个声明,最后两个参数具有默认值。 确保包含必要的头文件:
#include <tbb/concurrent_hash_map.h>
在我的TBB版本中,该文件具有:
template<typename Key, typename T, typename HashCompare = tbb_hash_compare<Key>, typename A = tbb_allocator<std::pair<Key, T> > >
class concurrent_hash_map;
相关文章:
- 使用模板参数化映射旧版 C 接口的接口中的类型
- 具有不同参数列表的模板对象的模板静态映射
- 映射可变参数模板参数
- 重载调用是不明确的:一对内联映射作为构造函数参数
- lambda 和映射,引用参数 - 编译错误
- 具有单个参数的布尔函数映射
- 模板.参数包扩展 - 重映射类型
- C++函数来返回基于参数的比较器通用映射类型?
- 使用按插入方式排序的参数创建哈希映射
- C++ 使用映射中的参数调用函数
- 将模板类型参数的映射存储到C++中的矢量中:Visual Studio
- 如何使用成员函数映射参数包?(非恢复性,折叠前表达式)
- C 11多态映射键静态断言失败:哈希函数必须与密钥类型的参数无关
- 映射枚举值为C 中的模板参数
- 重映射模板参数结构
- 使用 C++11 可变参数模板初始化枚举到字符串映射
- program_options变量映射更改参数
- std::使用compare参数映射检查第一个和第二个值
- 使用变量参数映射函数并通过字符串 c++ 调用
- 编译器不推导模板参数(映射std::vector->std::vector)