| 18 | std::unordered_map<KeyType, ValueType> map{}; |
| 19 | public: |
| 20 | bool get(const KeyType& key, ValueType& out) { |
| 21 | std::lock_guard lock{mutex}; |
| 22 | auto find_it = map.find(key); |
| 23 | if (find_it == map.end()) { |
| 24 | return false; |
| 25 | } |
| 26 | out = find_it->second; |
| 27 | return true; |
| 28 | } |
| 29 | |
| 30 | bool insert(const KeyType& key, ValueType val) { |
| 31 | std::lock_guard lock{mutex}; |
no test coverage detected