diff --git a/data_structures/map/hashmap.hpp b/data_structures/map/hashmap.hpp index 503e5121e..65d6aa692 100644 --- a/data_structures/map/hashmap.hpp +++ b/data_structures/map/hashmap.hpp @@ -10,9 +10,11 @@ namespace lockfree { template -class HashMap: Lockable { +class HashMap: Lockable +{ public: - V operator[](const K& key) + + V at(const K& key) { auto guard = acquire(); diff --git a/test/lockfree_hashmap.cpp b/test/lockfree_hashmap.cpp index 11b34002c..10af83438 100644 --- a/test/lockfree_hashmap.cpp +++ b/test/lockfree_hashmap.cpp @@ -4,7 +4,6 @@ TEST_CASE("Lockfree HashMap basic functionality") { lockfree::HashMap hashmap; - // hashmap[32] = 10; hashmap.put(32, 10); - REQUIRE(hashmap[32] == 10); + REQUIRE(hashmap.at(32) == 10); }