Daily bit(e) of C++ | LRU cache using std::shared_ptr
Daily bit(e) of C++ #431, Implementing thread-safe caches using std::shared_ptr.
The canonical use case for std::shared_ptr is a cache.
Items need to be removed from the cache to make space for fresh data, but we cannot invalidate memory that is still in use by in-progress operations.