An open API service indexing awesome lists of open source software.

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

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
```