/\_/\
( o.o )
> ^ <
HashMap
┌──────┐
│ │
└──────┘
┌──────┐ ┌──────┐ ┌──────┐
│ Key1 │ │ Key2 │ │ Key3 │
└──────┘ └──────┘ └──────┘
│ │ │
│ │ │
┌──┴───┐ ┌──┴───┐ ┌──┴───┐
│ Val1 │ │ Val2 │ │ Val3 │
└──┬───┘ └──┬───┘ └──┬───┘
│ │ │
│ │ │
┌───┴────┐ ┌───┴────┐ ┌───┴────┐
│ Hash1 │ │ Hash2 │ │ Hash3 │
└────────┘ └────────┘ └────────┘
the ASCII art is powered by ChatGPT
This is a hash table that meets STL requirements and its source is [CS106L-22winter-assignment3]
这是一个满足STL要求的哈希表,其来源是CS106L-22winter-assignment3
According to veteran C++ programmers, there are two projects which bring together all the knowledge that a proficient C++ programmer should have:
根据资深 C++ 程序员的说法,有两个项目汇集了熟练的 C++ 程序员应具备的所有知识:
- Implementing a STL-compliant template class; and 实现符合STL标准的模板类
- Implementing a macro to hash string literals at compile-time. 实现一个宏以在编译时散列字符串文字。
In this assignment, we will be putting #1 on your resume by completing a STL-compliant HashMap.
在本次作业中,我们将通过完成符合 STL 的 HashMap 来为您的简历加一分。
-
我理解了代码的结构
-
为之增加了const correctness
-
增加
copy assigenment
的普通版本和移动语义版本 -
增加
operator=
的普通版本和移动语义版本 -
修复析构函数内存溢出的bug
-
修复测试用例关乎移动语义的未定义行为的bug
-
根据build.sh,增加CMakeList
-
I understand the structure of the code
-
Added const correctness to it
-
Added normal version and move semantic version of
copy assigenment
-
Added normal version and move semantic version of
operator=
-
Fixed destructor memory overflow bug
-
Fixed a bug with undefined behavior of test cases related to move semantics
-
According to build.sh, add CMakeList