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
- Host: GitHub
- URL: https://github.com/agauniyal/canmap
- Owner: agauniyal
- License: mit
- Created: 2018-04-15T07:55:26.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-04-18T09:05:16.000Z (about 8 years ago)
- Last Synced: 2025-03-23T03:44:10.120Z (over 1 year ago)
- Topics: cpp, cpp17, hashmap
- Language: C++
- Size: 2.93 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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';
}
```