| 59 | |
| 60 | template <typename K> |
| 61 | Value* Find(K&& key) { |
| 62 | const auto it = map_.find(key); |
| 63 | if (it == map_.end()) { |
| 64 | return nullptr; |
| 65 | } else { |
| 66 | // Found => move item at front of the list |
| 67 | auto list_it = it->second; |
| 68 | items_.splice(items_.begin(), items_, list_it); |
| 69 | return &list_it->value; |
| 70 | } |
| 71 | } |
| 72 | |
| 73 | template <typename K, typename V> |
| 74 | std::pair<bool, Value*> Replace(K&& key, V&& value) { |