#pragma once #include #include #include template class HashTable { public: HashTable(size_t size) : size { size } , table(size) { } private: size_t size; std::vector>> table; std::hash hash_function; auto bucket_find_key(std::list> list, K key) { return std::find_if(list.begin(), list.end(), [&key](const std::pair& pair) { return pair.first == key; }); } bool bucket_contains_key(std::list> list, K key) { return bucket_find_key(list, key) != list.end(); } std::list> get_bucket(K key) { size_t index = hash_function(key) % size; return table.at(index); } };