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