当前位置:网站首页>unordered_ The hash function of map and the storage mode of hash bucket
unordered_ The hash function of map and the storage mode of hash bucket
2022-07-28 02:37:00 【There are trees in the mountain】
// The template parameters are Key type , Value type , hash function , Equal to comparator , Memory allocator
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;
}

边栏推荐
- 重要安排-DX12引擎开发课程后续直播将在B站进行
- 别人发你的jar包你如何使用(如何使用别人发您的jar包)
- 初识C语言 -- 结构体,分支和循环语句
- 使用BigDecimal类型应该避免哪些问题?(荣耀典藏版)
- From prediction to decision-making, Chapter 9 Yunji datacanvas launched the ylearn causal learning open source project
- 并发编程的三大核心问题(荣耀典藏版)
- POC模拟攻击利器 —— Nuclei入门(一)
- ps 简单使用
- Cesium3Dtilesets 使用customShader的解读以及泛光效果示例
- 修改MySQL密码的四种方法(适合初学者)
猜你喜欢

初识C语言 -- 结构体,分支和循环语句

Ceresdao: the world's first decentralized digital asset management protocol based on Dao enabled Web3.0

Notes for the fourth time of first knowing C language

小程序毕设作品之微信校园维修报修小程序毕业设计成品(4)开题报告

"Risking your life to upload" proe/creo product structure design - seam and buckle

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

MySQL high availability and master-slave synchronization

ERD online 4.0.0 free private deployment scheme

【软件测试】—— 自动化测试之unittest框架

With elephant & nbsp; Eplato created by swap, analysis of the high premium behind it
随机推荐
Use of Day6 functions and modules
Necessary knowledge points of software engineering
网络必知题目
Leetcode hot topic Hot 100 - > 2. Add two numbers
初识C语言 -- 结构体,分支和循环语句
作业7.27 IO进程
重要安排-DX12引擎开发课程后续直播将在B站进行
2022.7.8 supplement of empty Luna
When iPhone copies photos to the computer, the device connection often fails and the transmission is interrupted. Here's the way
基于stm32的恒功率无线充电
This operation may not be worth money, but it is worth learning | [batch cutting of pictures]
【LeetCode】13. Linked List Cycle·环形链表
Which database is the fastest to query data only?
获取两个集合相差数据
Design of edit memory path of edit box in Gui
Mysql Explain 详解(荣耀典藏版)
Flex layout - fixed positioning + flow layout - main axis alignment - side axis alignment - expansion ratio
一文读懂Plato&nbsp;Farm的ePLATO,以及其高溢价缘由
Notes for the fourth time of first knowing C language
Canonical Address