| 238 | return (bool)_objects.count(k); |
| 239 | } |
| 240 | inline void touch(const key_type& k) { |
| 241 | if (!this->contains(k)) { |
| 242 | throw std::runtime_error("Key not found in cache"); |
| 243 | } |
| 244 | rank_iterator rank = std::find(_ranked_keys.begin(), _ranked_keys.end(), k); |
| 245 | if (rank != _ranked_keys.begin()) { |
| 246 | // Move key to front of ranks |
| 247 | _ranked_keys.erase(rank); |
| 248 | _ranked_keys.push_front(k); |
| 249 | } |
| 250 | } |
| 251 | inline value_type& get(const key_type& k) { |
| 252 | if (!this->contains(k)) { |
| 253 | throw std::runtime_error("Key not found in cache"); |
no test coverage detected