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.
Click to open in Compiler Explorer.
Leave a comment