bool GetLRUElement(CacheEntry& value, bool remove) { if (m_cache_list.empty()) { return false; } value = m_cache_list.back(); if (remove) { m_entry_map.erase(value.first); m_cache_list.pop_back(); } return true; }
bool GetLRUElement(value_type& value, bool remove) { if (m_cache_list.empty()) { return false; } CacheEntry & entry = m_cache_list.back(); value = entry.second; if (remove) { m_entry_map.erase(entry.first); m_cache_list.pop_back(); } return true; }