A header only C++11 LRU Cache template class that allows you to define key, value and optionally the Map type. uses a double linked list and a std::unordered_map style container to provide fast insert, delete and update No dependencies other than the C++ standard library. This is a C++11 remake of my earlier LRUCache project (https://github.com/mohaps/lrucache) The goal was to create a fast LRUCache header only library and to avoid any dependencies like boost.
When there is only 1 item in the list, a newly appended n node didn't have the prev property set correctly. This leads to segfaults when calling get on the second item, because we later try to de-reference a nullptr that should be pointing to head.
When there is only 1 item in the list, a newly appended
n
node didn't have theprev
property set correctly. This leads to segfaults when callingget
on the second item, because we later try to de-reference anullptr
that should be pointing tohead
.