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

https://github.com/agauniyal/canmap

different hashmap implementations
https://github.com/agauniyal/canmap

cpp cpp17 hashmap

Last synced: about 1 year ago
JSON representation

different hashmap implementations

Awesome Lists containing this project

README

          

# canmap
different hashmap implementations

```cpp
#include "include/solid_bucket.hpp"
#include
#include

int main()
{
HashMap map{};
std::cout << map.size() << '-' << std::boolalpha << map.empty() << '\n';
map["Pi"] = 112.0;
map["Blue"] = 123.45;
map["Pi"] = (22 / 7);
map["Hello"] = 2324.001;
std::cout << map.size() << '-' << std::boolalpha << map.empty() << '\n';
std::cout << "Value of Pi: " << map["Pi"] << '\n';
map.for_each([](const auto &key, const auto &value) {
std::cout << key << ": " << value << '\n';
});
std::cout << std::boolalpha << (map.count("Pi") == 1) << '\n';
map.erase("Pi");
std::cout << std::boolalpha << (map.count("Pi") == 0) << '\n';
std::cout << map.size() << '-' << std::boolalpha << map.empty() << '\n';
map.clear();
std::cout << map.size() << '-' << std::boolalpha << map.empty() << '\n';
}
```