Commit ca8d6b1f authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

Add an helper to discard a value from cache

parent b75e9ac5
......@@ -110,6 +110,16 @@ class Cache
Store.clear();
}
static bool discard( const typename CACHEPOLICY::KeyType& key )
{
std::lock_guard<std::mutex> lock( Mutex );
auto it = Store.find( key );
if ( it != Store.end() )
return false;
Store.erase( it );
return true;
}
protected:
/*
* Create a new instance of the cache class.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment