当前位置:网站首页>unordered_map的hash function及hash bucket存储方式探索
unordered_map的hash function及hash bucket存储方式探索
2022-07-28 01:22:00 【山有木兮啊】
// 模板参数依次为 键类型,值类型, 哈希函数,等于比较器, 内存分配器
template <class _Kty, class _Ty,
class _Hasher = hash<_Kty>,
class _Keyeq = equal_to<_Kty>,
class _Alloc = allocator<pair<const _Kty, _Ty>>>
class unordered_map : public _Hash<_Umap_traits<_Kty, _Ty, _Uhash_compare<_Kty, _Hasher, _Keyeq>, _Alloc, false>> {
}
// \2019\Enterprise\VC\Tools\MSVC\14.29.30133\include\type_traits
// hash function
#if defined(_WIN64)
constexpr size_t _FNV_offset_basis = 14695981039346656037ULL;
constexpr size_t _FNV_prime = 1099511628211ULL;
#else // defined(_WIN64)
constexpr size_t _FNV_offset_basis = 2166136261U;
constexpr size_t _FNV_prime = 16777619U;
#endif // defined(_WIN64)
inline size_t _Fnv1a_append_bytes(size_t _Val, const unsigned char* const _First,
const size_t _Count) noexcept {
// accumulate range [_First, _First + _Count) into partial FNV-1a hash _Val
for (size_t _Idx = 0; _Idx < _Count; ++_Idx) {
_Val ^= static_cast<size_t>(_First[_Idx]);
_Val *= _FNV_prime;
}
return _Val;
}

边栏推荐
- Xiaomi website homepage big module - small module + navigation (floating case)
- Under the new retail format, retail e-commerce RPA helps reshape growth
- Promise from introduction to mastery (Chapter 1 Introduction and basic use of promise)
- Explore flex basis
- 网络必知题目
- 【HCIP】路由策略、策略路由
- Unity 保存图片到相册以及权限管理
- Flex layout - fixed positioning + flow layout - main axis alignment - side axis alignment - expansion ratio
- LeetCode 热题 HOT 100 -> 3. 无重复字符的最长子串
- 上课笔记(5)(1)——#593. 二分查找(binary)
猜你喜欢
![This operation may not be worth money, but it is worth learning | [batch cutting of pictures]](/img/e8/a34e471b0089f8085b140c74b5c01f.jpg)
This operation may not be worth money, but it is worth learning | [batch cutting of pictures]

Clear the cause of floating and six methods (solve the problem that floating affects the parent element and the global)

Wechat campus bathroom reservation applet graduation design finished product (2) applet function

With elephant & nbsp; Eplato created by swap, analysis of the high premium behind it

正则表达式

APP如何上架App Store?

ArcGIS: loading historical remote sensing images

CeresDAO:Ventures DAO的“新代言”

Xiaomi website homepage big module - small module + navigation (floating case)

MySQL explain (glory Collection Edition)
随机推荐
JVM tuning -xms -xmx -xmn -xss
Ceresdao: new endorsement of ventures Dao
功能测试和非功能测试区别简析,上海好口碑软件测试公司推荐
小程序毕设作品之微信校园浴室预约小程序毕业设计成品(2)小程序功能
cn+dt
LeetCode 热题 HOT 100 -> 2.两数相加
埃睿迪再度亮相数字中国峰会 持续深化用科技守护绿水青山
What is eplato cast by Plato farm on elephant swap?
MySQL's way to solve deadlock - lock analysis of common SQL statements
feign调用get和post记录
retainface使用报错:ModuleNotFoundError: No module named 'rcnn.cython.bbox'
Wechat campus bathroom reservation applet graduation design finished product (1) development outline
"The faster the code is written, the slower the program runs"
How to put app on the app store?
Leetcode hot topic Hot 100 - > 2. Add two numbers
Two ways for wechat applet to realize dynamic horizontal step bar
Unittest unit test framework full stack knowledge
LeetCode 热题 HOT 100 -> 1.两数之和
【ROS进阶篇】第九讲 基于Rviz和Arbotix控制的机器人模型运动
Leetcode hot topic Hot 100 - > 3. longest substring without repeated characters