https://github.com/esrrhs/coalesced_hashmap
C++ Coalesced HashMap
https://github.com/esrrhs/coalesced_hashmap
Last synced: about 1 month ago
JSON representation
C++ Coalesced HashMap
- Host: GitHub
- URL: https://github.com/esrrhs/coalesced_hashmap
- Owner: esrrhs
- License: mit
- Created: 2024-06-06T10:05:36.000Z (12 months ago)
- Default Branch: master
- Last Pushed: 2024-08-07T08:48:27.000Z (9 months ago)
- Last Synced: 2025-02-13T05:24:16.210Z (3 months ago)
- Language: C++
- Size: 29.3 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# coalesced_hashmap
C++ [Coalesced_hashing](https://en.wikipedia.org/wiki/Coalesced_hashing), inspired by Lua table implementation.
header only, no dependencies.## Usage
```cpp
CoalescedHashMap map;
map.Insert("key", 1);
int value = 0;
if (map.Find("key", value)) {
std::cout << "found" << std::endl;
}
for (auto it = map.Begin(); it != map.End(); ++it) {
std::cout << "key: " << it.GetKey() << " value: " << it.GetValue() << std::endl;
}
if (map.Erase("key")) {
std::cout << "erased" << std::endl;
}
```## Build
```bash
mkdir build
cd build
cmake ..
make
```